04.08.2011, 19:25
It's kinda impossible to explain it without using code - So here's my go at it.
In sscanf you use specifiers, these specifiers help the system decide what you're trying to use as parameters; Like so:
In this example, "Player" is the ID you have selected, and "playerid" is the person who has typed the command.
I hope this helped.
In sscanf you use specifiers, these specifiers help the system decide what you're trying to use as parameters; Like so:
pawn Код:
new Player;
if(sscanf(params, "u", Player)) //what happens if they just type "/commandname"?
return SendClientMessage(playerid, -1, "Usage: /commandname [playerid]");
//what happens if they use the correct parameters?
new string[128], player_Name[MAX_PLAYER_NAME];
GetPlayerName(Player, player_Name, sizeof(player_Name));
format(string, sizeof(string), "You've typed: \"/commandname %d\", and have selected %s! (ID: %d)", Player, player_Name, Player);
SendClientMessage(playerid, -1, string); //Sends YOU this message.
I hope this helped.

