OnPlayerRequestClass
From SA-MP Wiki
OnPlayerRequestClass
This callback is called when a player respawns after he have pressed F4 or when he first connects to the server, instead of spawning him.
(playerid)
| playerid | ID of the player who entered class selection. |
| classid | The ID of the current class being viewed, classids are assigned when AddPlayerClass is used, and is also returned by it. |
Template:Return 0 will not spawn the player.
public OnPlayerRequestClass(playerid,classid) { if(classid == 3 && !IsPlayerAdmin(playerid)) { SendClientMessage(playerid,COLOR_GREEN,"This skin is only for admins!"); return 0; } return 1; }
Only notifying them, to stop them using it, see AdminSkins.
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 tries to spawn from 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.
