SpawnPlayer only works when pressing arrows/spawn - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SpawnPlayer only works when pressing arrows/spawn (
/showthread.php?tid=244132)
SpawnPlayer only works when pressing arrows/spawn -
Jochemd - 26.03.2011
Hello,
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
if(GetPVarInt(playerid,"IsLogged") == 0)
{
new ip[16],string[128],Playername[MAX_PLAYER_NAME];
GetPlayerIp(playerid,ip,sizeof(ip));
GetPlayerRPName(playerid,Playername,sizeof(Playername));
format(string,sizeof(string),"JOIN: {008000}%s (ID: %d). {008000}IP: %s. Country: %s",Playername,playerid,ip,GetPlayerCountryName(playerid));
SendAdminMessage(COLOR_GREEN,string);
format(string,sizeof(string),"INGAME JOIN: %s (ID: %d).",Playername,playerid);
IRC_Say(IrcBot,"#GTAProductions",string);
}
SpawnPlayer(playerid);
return 1;
}
With this code I got a weird problem. The player only spawns when I press one of the arrows, so that would mean OnPlayerRequestClass is not called when you go to the class request. What is the problem?
Note: OnPlayerRequestSpawn returns 1.
Jochem
Re: SpawnPlayer only works when pressing arrows/spawn -
antonio112 - 26.03.2011
First, you have to use
pawn Код:
SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:Angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
before you can use SpawnPlayer, so do that
Re: SpawnPlayer only works when pressing arrows/spawn -
Jochemd - 26.03.2011
It fixed it, thanks