OnPlayerRequestClass

From SA-MP Wiki

Jump to: navigation, search

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.


Parameters:
(playerid)
playeridID of the player who entered class selection.
classidThe 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.


Related Functions

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

Personal tools