SA-MP Forums Archive
SetSpawnInfo problem. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SetSpawnInfo problem. (/showthread.php?tid=423573)



SetSpawnInfo problem. - BaubaS - 18.03.2013

Good day. I have a problem when making player spawn when he loggs in. The problem is that sometimes SetSpawnInfo sets player skin as CJ, and sometimes as player's real skin. So that makes player spawn with CJ spawn sometimes. Maybe someone knows how to fix that one?

pawn Код:
forward OnPlayerDataLoad(playerid);
public   OnPlayerDataLoad(playerid)
{
           <...>
           new userSkin;
    cache_get_row(0, 9, Result); SetPlayerSkin(playerid, strval(Result));
    userSkin = strval(Result);

           <....>

    SetSpawnInfo(playerid, 0, userSkin, userPos[0], userPos[1], userPos[2], 0, 0, 0, 0, 0, 0, 0);
    SpawnPlayer (playerid);
    return (true);
}



Re: SetSpawnInfo problem. - Misiur - 18.03.2013

Quick fix would be SetPlayerSkin in OnPlayerSpawn callback. But if there is a better fix, I'd be glad to hear it as well


Re: SetSpawnInfo problem. - Scenario - 18.03.2013

Just call "SetPlayerSkin" after you spawn the player.