19.06.2011, 20:34
Quote:
So. 1st you make a variable like new pName[MAX_PLAYER_NAME];
Max Player Name is how long the name can be (You can also put 24 or less but if the player name is longer than the value you put it will not show the whole name. Now make a new variable. new string[256]; There's 256 because we do not need a longer string than a one with 256 cells. Okay, so we give the pName variable a function: GetPlayerName(playerid,pName,sizeof(pName); That means that pName will now show the player's name. Now let us format the string: format(string,sizeof(string),"%s(%i) has joined the server",pName,playerid); %s means that's a string, %i that's an integer(number). Now let us send a message to the whole server someone joined: SendClientMessageToAll(0xFFCC00,string); That's all. |