16.01.2013, 17:34
Let's give you an example command. You're not interpreting what ****** is actually meaning by this. When you use sscanf, you would only return something if they have got the syntax wrong or are missing a parameter.
For example:
So your code would be something like:
Obviously, you don't have to return with SendClientMessage, you can use ShowPlayerDialog if that is what you're wanting to do.
For example:
pawn Код:
CMD:kick(playerid, params[]) //My command /kick to kick players
{
new playersID; //This is what we use to save the ID of the player we want to kick
if(sscanf(params, "u", playersID)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /kick [playerid]"); //Is returned because I did not add the 'playerid' part of the command
if(playersID == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000FF, "Player is not connected."); //Is only returned if you have included all parameters
//continues...
pawn Код:
new play[MAX_PLAYER_NAME];
new playID;
if(sscanf(inputtext, "u", playID)) return SendClientMessage(playerid, 0xFF0000FF, "You must enter an id.");
if(playID == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000FF, "Player is not connected.");
//Code continues