SA-MP Forums Archive
OnPlayerSpawn don't call. - 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: OnPlayerSpawn don't call. (/showthread.php?tid=546488)



OnPlayerSpawn don't call. - xHanks - 15.11.2014

I made this code for when spawn give him this weappons and send one message, didn't do anything.

pawn Код:
public OnPlayerConnect(playerid)
{
SetSpawnInfo(playerid, 0, 281, 1130.2911,-1456.9148,15.7969, 0, 0, 0, 0, 0, 0, 0 );
SendClientMessage(playerid, -1, "Bienvenido a Los Angeles RolePlay");
}

public OnPlayerRequestClass(playerid,classid)
{
SpawnPlayer(playerid);
}

public OnPlayerSpawn(playerid)
{
SendClientMessage(playerid, -1, "ЎHAS SPAWNEADO AL CENTRO COMERCIAL!");
GivePlayerWeapon(playerid, 35, 1000);
GivePlayerWeapon(playerid, 43, 1000);
SetPlayerHealth(playerid, 1);
}



Re: OnPlayerSpawn don't call. - Kwarde - 15.11.2014

Did you add '#include <a_samp>' aswell (I don't know if this literally is your whole script). Also, is this a gamemode or a filterscript? If it's a filterscript, make sure you load it. And as last but not least, did your compile your script?
Just asking these nooby questions since the script seems to be right.


Respuesta: OnPlayerSpawn don't call. - xHanks - 15.11.2014

Yes, it's one gamemode, the include is here, i don't know why don't do the function, really, wanna suicide.


Re: OnPlayerSpawn don't call. - Kwarde - 15.11.2014

"Exaggeration is also a course"

Did you already spawn aswell? Because sometimes, SpawnPlayer() doesn't seem to work (atleast, I experienced that a couple of times) in OnPlayerRequestClass