OnPlayerSpawn

From SA-MP Wiki

Jump to: navigation, search

OnPlayerSpawn


This callback is called when a player spawns.


Parameters:
(playerid)
playeridID of the player who spawned.


This function does not return a specific value, it's best to simply ignore it.


public OnPlayerSpawn(playerid)
{
    new PlayerName[MAX_PLAYER_NAME],
    string[128]; 
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    format(string, sizeof(string), "%s has spawned.", PlayerName);
    SendClientMessageToAll(0xFFFFFFFF, string);
}

Related Callbacks

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

Personal tools