ForceClasSelection - 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: ForceClasSelection (
/showthread.php?tid=421019)
ForceClasSelection -
ross8839 - 07.03.2013
How can I force the class selection...?
I have random spawns within my script and when I type this command in, you can choose your class but it doesn't return to the class selection screen. This is what happens - i type /kill and die, depending on what team I'm on, it will place my character and one of the random spawns across Los Santos and let me choose my character. If I'm Criminal, I want to type /kill and change to a Cop, I will spawn at one of the Criminal Random Spawns...?
Here is the /kill command, request for more of my script if you want it. This is done directly from a tutorial so I claim no credit. I'm just trying to implement this command with the script!
pawn Код:
CMD:kill(playerid, cmdtext)
{
SetPlayerHealth(playerid, 0);
ForceClassSelection(playerid);
return 1;
}
Re: ForceClasSelection -
rangerxxll - 07.03.2013
You have it backwards. You want to ForceClassSelection, and then kill the player.
Re: ForceClasSelection -
ross8839 - 07.03.2013
Okay, thanks
Re: ForceClasSelection -
[CG]Milito - 07.03.2013
Try this
pawn Код:
CMD:kill(playerid, cmdtext)
{
SetPlayerHealth(playerid, 0);
ForceClassSelection(playerid);
TogglePlayerSpectating(playerid, true);
TogglePlayerSpectating(playerid, false);
return 1;
}