@@ -50,14 +50,20 @@ function gameModeInit(player)
50
50
if not isElement (player ) or getElementType (player ) ~= ' player' then
51
51
return
52
52
end
53
- repeat until spawnPlayer (player , math.random (- 20 , 20 ), math.random (- 20 , 20 ), 3 , math.random (0 , 359 ), math.random (9 , 288 ))
53
+ repeat until onPlayerInitSpawnPlayer (player , math.random (- 20 , 20 ), math.random (- 20 , 20 ), 3 , math.random (0 , 359 ), math.random (9 , 288 ))
54
54
end ,
55
55
5000 ,
56
56
1
57
57
)
58
58
end
59
59
end
60
60
61
+ function onPlayerInitSpawnPlayer (player , x , y , z , rotation , skinid )
62
+ local playerID = getElemID (player )
63
+ g_Players [playerID ].spawnedfromgamemodeinit = true
64
+ return spawnPlayer (player , x , y , z , rotation , skinid )
65
+ end
66
+
61
67
function joinHandler (player )
62
68
local playerJoined = not player
63
69
if playerJoined then
@@ -250,7 +256,7 @@ addEventHandler('onPlayerSpawn', root,
250
256
function ()
251
257
local playerID = getElemID (source )
252
258
local playerdata = g_Players [playerID ]
253
- if playerdata .doingclasssel or playerdata .beingremovedfromvehicle then
259
+ if playerdata .doingclasssel or playerdata .beingremovedfromvehicle or playerdata . spawnedfromgamemodeinit then
254
260
return
255
261
end
256
262
toggleAllControls (source , true )
0 commit comments