Learning Format ?
#10

Quote:
Originally Posted by ServerScripter
Посмотреть сообщение
So , if i want to get the Player's ID :
Ex : In Chat , i want to see ID of Each Player
pawn Код:
new text
new string
format(string, sizeof(string), "X[id:%d]:%s, GetPlayerId,text");
? or what ?
pawn Код:
public OnPlayerText(playerid, text[])
{
    // Create a new string of length 128 characters
    new string[128];
    // Create the line to send (put the value of "playerid" at the "%i", then insert the given text at the "%s"
    format(string, sizeof(string), "X[id: %i]: %s", playerid, text);
    // Send this to all players
    SendClientMessageToAll(0xFFFFFFFF, string);

    // block the normal text to be written to the chatbox, as the SendClientMessageToAll line sends the required text already
    return 0;
}
Reply


Messages In This Thread
Learning Format ? - by ServerScripter - 02.10.2011, 19:14
Re: Learning Format ? - by =WoR=Varth - 02.10.2011, 19:16
Re: Learning Format ? - by ServerScripter - 02.10.2011, 19:21
Re: Learning Format ? - by Kingunit - 02.10.2011, 19:23
Re: Learning Format ? - by ServerScripter - 02.10.2011, 19:24
Re: Learning Format ? - by Jafet_Macario - 02.10.2011, 19:25
Re: Learning Format ? - by GrimR - 02.10.2011, 19:29
Re: Learning Format ? - by ServerScripter - 02.10.2011, 19:32
Re: Learning Format ? - by Kingunit - 02.10.2011, 19:39
Re: Learning Format ? - by PowerPC603 - 02.10.2011, 19:42

Forum Jump:


Users browsing this thread: 1 Guest(s)