warning Not Translated
This page has not been translated into the language that your browser requested yet. The English content is being shown as a fallback.
If you want to contribute a translation for this page then please click here.
OnPlayerRequestClass
Description
This callback is called when a player changes class at class selection (and when class selection first appears).
Name | Description |
---|---|
playerid | The ID of the player that changed class. |
classid | The ID of the current class being viewed (returned by AddPlayerClass). |
Returns
It is always called first in filterscripts.
Examples
public OnPlayerRequestClass(playerid,classid)
{
if (classid == 3 && !IsPlayerAdmin(playerid))
{
SendClientMessage(playerid, COLOR_RED, "This skin is only for admins!");
return 0;
}
return 1;
}
Notes
tip
This callback is also called when a player presses F4.
Related Callbacks
The following callbacks might be useful, as they're related to this callback in one way or another.
- OnPlayerRequestSpawn: This callback is 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 player class.