OnPlayerRequestSpawn

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 02:47, 30 December 2009
Mikep (Talk | contribs)

← Previous diff
Revision as of 00:07, 1 February 2014
Connor Mead (Talk | contribs)

Next diff →
Line 1: Line 1:
{{Scripting}} {{Scripting}}
-{{Title}} 
{{Description|Called when a player attempts to spawn via class selection.}} {{Description|Called when a player attempts to spawn via class selection.}}
Line 10: Line 9:
<pawn> <pawn>
-public OnPlayerRequestSpawn(playerid)+public OnPlayerRequestClass(playerid)
{ {
if(!IsPlayerAdmin(playerid)) if(!IsPlayerAdmin(playerid))
Line 25: Line 24:
[[Category:Scripting_Callbacks]] [[Category:Scripting_Callbacks]]
 +
 +[[fr:OnPlayerRequestClass]]

Revision as of 00:07, 1 February 2014



Description:

Called when a player attempts to spawn via class selection.


Parameters:
(playerid)
playeridThe ID of the player who requested to spawn.


Return Values:

Returning 0 in this callback will prevent the player from spawning


public OnPlayerRequestClass(playerid)
{
    if(!IsPlayerAdmin(playerid))
    {
        SendClientMessage(playerid,COLOR_GREEN,"You may not spawn.");
        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.

In other languages