[BUG] Bug with first spawn
Posted: March 1st, 2019, 11:19 am
Description:
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:
And after join, I have $500, 200hp and don't have a weapon.
With 'onPlayerCredential'
Like above, but skin, color and spawn position works.
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")