OnPlayerConnect

From SA-MP Wiki

Jump to: navigation, search

OnPlayerConnect


This callback is called when a player connects to the server.


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


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


public OnPlayerConnect(playerid)
{
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"%s has joined the server. Welcome!",pName);
    SendClientMessageToAll(0xFFFFFFAA,string);
    return 1;
}

Related Callbacks

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

Personal tools