PDA

View Full Version : ForceClasSelection


ross8839
07/03/2013, 09:32 PM
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!

CMD:kill(playerid, cmdtext)
{
SetPlayerHealth(playerid, 0);
ForceClassSelection(playerid);
return 1;
}

rangerxxll
07/03/2013, 09:35 PM
You have it backwards. You want to ForceClassSelection, and then kill the player.

ross8839
07/03/2013, 09:36 PM
Okay, thanks :)

[CG]Milito
07/03/2013, 09:45 PM
Try this

CMD:kill(playerid, cmdtext)
{
SetPlayerHealth(playerid, 0);
ForceClassSelection(playerid);
TogglePlayerSpectating(playerid, true);
TogglePlayerSpectating(playerid, false);
return 1;
}