First spawn - event 'onPlayerSpawn' doesn't work and not all functions works on 'onPlayerCredential' event.
Reproducible:
Always
What you were doing when the bug happened:
With onPlayerSpawn:
Code: Select all
function onPlayerSpawned(playerid)
setPlayerCash(playerid, 0)
setPlayeHealth(playerid, 150)
givePlayerWeapon(playerid, 15, 600)
end
registerEvent("onPlayerSpawned", "onPlayerSpawn")
With 'onPlayerCredential'
Code: Select all
function onPlayerJoin(playerid)
print("[JOIN] [" .. playerid .. "] [ " .. getPlayerName(playerid) .. " ] IP: [ " .. getPlayerIp(playerid) .. " ]")
local sId = math.random(1, #spawnInfo)
spawnPlayer(playerid, spawnInfo[sId][1], spawnInfo[sId][2], spawnInfo[sId][3])
setPlayerSkin(playerid, spawnInfo[sId][4])
setPlayerColor(playerid, spawnInfo[sId][5])
setPlayerCash(playerid, 0)
setPlayeHealth(playerid, 150)
givePlayerWeapon(playerid, 15, 600)
end
registerEvent("onPlayerJoin", "onPlayerCredential")