Player-ID
#3

Let me explain the above command.

pawn Код:
public OnPlayerConnect(playerid) //This callback gets called each time a player connectes to your server
{
    new name[MAX_PLAYER_NAME], string[128]; //Creating a new string called "name" its size is 24(MAX_PLAYER_NAME = 24), creating another string called "string" and with the size of 128(Maximum SA-MP Text output)
    GetPlayerName(playerid, name, sizeof(name)); //Getting our name(playerid) and storing it in our string "name". If you login with the name "TestMaster" our "name" string will store your name "TestMaster" because we added this function(GetPlayerName)
    format(string, sizeof(string), "%s [ID %d] has joined the server", name,playerid); // Formating our "string" that we just created. Now if you go ingame with the name "TestMaster" our string "string" will get formated like this: TestMaster [ID: 0] has joined the server
    SendClientMessageToAll(-1, string); //Sending our formated string "string".
    return 1;
}
Reply


Messages In This Thread
Player-ID - by Blackazur - 20.11.2012, 15:50
Re: Player-ID - by vernz - 20.11.2012, 15:52
Re: Player-ID - by gtakillerIV - 20.11.2012, 16:19

Forum Jump:


Users browsing this thread: 2 Guest(s)