is invalidname
#5

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:
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...
So your code would be something like:
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
Obviously, you don't have to return with SendClientMessage, you can use ShowPlayerDialog if that is what you're wanting to do.
Reply


Messages In This Thread
is invalidname - by speed258 - 15.01.2013, 13:07
Re: is invalidname - by Shabi RoxX - 15.01.2013, 13:14
Re: is invalidname - by speed258 - 15.01.2013, 14:33
Re: is invalidname - by speed258 - 16.01.2013, 17:25
Re: is invalidname - by Threshold - 16.01.2013, 17:34

Forum Jump:


Users browsing this thread: 4 Guest(s)