03.11.2010, 18:00
sscanf: use this. It will be pretty simple to use. Please note you need the plugin or the code to use :P
Example:
I hope you do not mind my kind of identing. I think it's the best
Example:
pawn Код:
dcmd_me(playerid,params[])
{
new text[128],Playername[MAX_PLAYER_NAME]; // will create a text string with 128 cells (= maximum) and a Playername with maximum name input.
if(!sscanf(params,"s",text))
{
new string[128]; // will create a new string with 128 cells.
GetPlayerName(playerid,Playername,sizeof(Playername)); // will get players name and store it in Playername.
format(string,sizeof(string),"%s %s",Playername,text); // First %s = Playername... Second %d = text
SendClientMessageToAll(COLOR_WHITE,string); // Sends the text!
}
else return SendClientMessage(playerid,COLOR_RED,"Syntax Error: /me 'text'."); // if the player did not type the things correctly.
return 1;
}