ForceClassSelection
From SA-MP Wiki
Description:
Forces a player to go back to class selection.
(playerid)
playerid | The player to send back to class selection. |
Return Values:
This function does not return any specific values.
Important | The player will not return to class selection until they re-spawn. This can be achieved with TogglePlayerSpectating, as seen in the below example. |
Important | This function does not perform a state change to PLAYER_STATE_WASTED when combined with TogglePlayerSpectating (see example below), as is listed here. |
if(!strcmp(cmdtext, "/class", true)) { ForceClassSelection(playerid); TogglePlayerSpectating(playerid, true); TogglePlayerSpectating(playerid, false); return 1; }
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- AddPlayerClass: Add a class.
- SetPlayerSkin: Set a player's skin.
- GetPlayerSkin: Get a player's current skin.
Related Callbacks
The following callbacks might be useful, as they're related to this function in one way or another.
- OnPlayerRequestClass: Called when a player changes class at class selection.