spawn a player - 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: spawn a player (
/showthread.php?tid=277499)
spawn a player -
Urefeu - 18.08.2011
Hello.
I would like to make, instead that the player can choose his class, he is directly spawn.
My code :
Код:
public OnPlayerRequestClass(playerid, classid) // When the player choose his class
SpawnPlayer(playerid);
return 1;
}
But here I must click on "Spawn" for spawn.
The choice of position, skin and all are in the OnPlayerSpawn.
Thank you!
Re: spawn a player -
Norck - 18.08.2011
Do you have a registration/login system? If so, then just put SpawnPlayer right after player has registered/logged in. Otherwise try to use SpawnPlayer in OnPlayerConnect callback.
Hope it will help.
Re: spawn a player -
Hiddos - 18.08.2011
Have you tried putting it at OnPlayerConnect? (Also, I though OnPlayerRequestClass was also called at the first class?)
Re : spawn a player -
Urefeu - 18.08.2011
When I put the spawn depending on my connection in the OnDialogResponse, it does nothing more and I am entitled to a beautiful bug when I click on Spawn.
Re : spawn a player -
Urefeu - 19.08.2011
I solved the bug, it was due to the absence of AddPlayerClass.
How to take the step of clicking on Spawn?
Thank you!
Re: spawn a player -
Abreezy - 19.08.2011
Under your register or login do the following:
pawn Код:
SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:Angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
SpawnPlayer(playerid);
Just edit the setspawn info, and it works perfectly, you can remove the requestclass public.