From SA-MP Wiki

Revision as of 14:10, 30 December 2017; view current revision
←Older revision | Newer revision→
Jump to: navigation, search


Called when a player changes class at class selection (and when class selection first appears).



This callback can also be called by NPC.

(playerid, classid)
playeridThe ID of the player that changed class.
classidThe ID of the current class being viewed (returned by AddPlayerClass).

Return Values:

Returning 0 in this callback will prevent the player from spawning. The player can be forced to spawn when SpawnPlayer is used.
  • It is always called first in filterscripts.



This callback is also called when a player presses F4.

public OnPlayerRequestClass(playerid,classid)
    if(classid == 3 && !IsPlayerAdmin(playerid))
        SendClientMessage(playerid, COLOR_RED, "This skin is only for admins!");
        return 0;
    return 1;

Related Callbacks

The following callbacks might be useful as well, as they are related to this callback in one way or another.

Related Functions

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

Personal tools
In other languages