OnPlayerRequestClass
From SA-MP Wiki
OnPlayerRequestClass
Called when a player changes class at class selection.
(playerid, classid)
| playerid | The ID of the player that changes class. |
| classid | The ID of the current class being viewed. |
This callback does not handle returns.
Note: Class IDs are assigned when AddPlayerClass is used.
Note: This callback is also called when a player presses F4
public OnPlayerRequestClass(playerid,classid) { if(classid == 3 && !IsPlayerAdmin(playerid)) { SendClientMessage(playerid,COLOR_GREEN,"This skin is only for admins!"); } return 1; }
Related Callbacks
The following callbacks might be useful as well, as they're related to this callback in one way or another.
- OnPlayerRequestSpawn: Called when a player attempts to spawn via class selection.
Related Functions
The following functions might be useful, as they're related to this callback in one way or another.
- AddPlayerClass: Add a class.
