ForceClassSelection

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 13:24, 27 September 2011
Smithy (Talk | contribs)
(Related callbacks)
← Previous diff
Revision as of 04:38, 19 June 2012
Smithy (Talk | contribs)

Next diff →
Line 3: Line 3:
{{Description|Forces a player to go back to the class selection.}} {{Description|Forces a player to go back to the class selection.}}
- 
-{{note2|To force a player to class selection, you must kill them after using this function. You can also use [[TogglePlayerSpectating]].}} 
{{Parameters|playerid}} {{Parameters|playerid}}
Line 10: Line 8:
{{NoReturn}} {{NoReturn}}
 +
 +{{note2|The player will not return to class selection until they re-spawn. This can be achieved with TogglePlayerSpectating, as seen in the below example.}}
<pawn> <pawn>
Line 15: Line 15:
{ {
ForceClassSelection(playerid); ForceClassSelection(playerid);
- SetPlayerHealth(playerid,0);+ TogglePlayerSpectating(playerid, true);
 + TogglePlayerSpectating(playerid, false);
return 1; return 1;
} }
Line 21: Line 22:
{{RelatedFunctions}} {{RelatedFunctions}}
 +{{AddPlayerClass}}
{{SetPlayerSkin}} {{SetPlayerSkin}}
{{GetPlayerSkin}} {{GetPlayerSkin}}

Revision as of 04:38, 19 June 2012




Description:

Forces a player to go back to the class selection.


Parameters:
(playerid)
playeridThe player you want to send back to the class selection.


Return Values:

This function does not return any specific values.


Image:32px-Circle-style-warning.png

Important
Note

The player will not return to class selection until they re-spawn. This can be achieved with TogglePlayerSpectating, as seen in the below example.


if(!strcmp(cmdtext, "/class", true))
{
    ForceClassSelection(playerid);
    TogglePlayerSpectating(playerid, true);
    TogglePlayerSpectating(playerid, false);
    return 1;
}

Related Functions

The following functions may be helpful as they relate to this function in one way or another.


Related Callbacks

The following callbacks might be useful, as they're related to this function in one way or another.

Personal tools