sscanf problem
#1

i have a command that working and everything ok
but the problem is that every time when i use the command
the console write me
Quote:

sscanf warning: format specifier does not match parameter count.

the command.
PHP код:
       command(adpilplayeridparams[])
       {
       if(
AdminLevel[playerid] == 1337)
       {
    new 
string[128];
    new 
ID;
    if(
sscanf(params"ui"ID))
    {
        
SendClientMessage(playeridRed"Usage: /adpil (PlayerID)");
        return 
1;
    }
    if(!
IsPlayerConnected(ID))
    {
        
SendClientMessage(playeridRed"That player ID is not connected.");
        return 
1;
    }
    if(
PlayerLevel[ID] > 200)
    {
        
SendClientMessage(playeridGreen"That player is already a pilot or higher.");
        return 
1;
    }
     new 
pname[128];
     
GetPlayerName(IDpnamesizeof(pname));
     
format(stringsizeof(string), "Server Admin has made player %s a War Pilot."pname);
     
SendClientMessageToAll(Bluestring);
      
SendClientMessage(IDBlue"Server Admin has given you Pilot Status. You can now fly the Rustlers, 
      IRC_Say(gGroupID, IRC_CHANNEL, string);
    PlayerLevel[ID] =200;
       TextDrawHideForPlayer(playerid, himessage);
        new newtext[41];
    format(string, sizeof(string), "
Level:%d", PlayerLevel[playerid]);
    TextDrawSetString(himessage, string);
        TextDrawShowForPlayer(playerid, himessage);
    return 1;
    }
    SendClientMessage(playerid, Red, "
Invalid Command");
    return 1;

the problem start when i put that i command
PHP код:
        new newtext[41];
    
format(newtextsizeof(newtext), "Level:%d"PlayerLevel[playerid]);
    
TextDrawSetString(himessagenewtext);
        
TextDrawShowForPlayer(playeridhimessage); 
Reply
#2

You enlist 'i' which specifies and integer, though you do not use it?

PHP код:
if(sscanf(params"u"ID)) 
Reply
#3

it still writing that
Reply
#4

i think you don't need "i" specifier. try

pawn Код:
if(sscanf(params, "u", ID))
Reply
#5

yea man tnx !!!!!!!!!
working
Reply
#6

you're welcome.
Reply
#7

PHP код:
COMMAND:adpil(playeridparams[]) {
    new
        
string[128],
        
id,
        
plname[MAX_PLAYER_NAME],
        
newtext[41];
      
GetPlayerName(idplnamesizeof(plname));
    if(
AdminLevel[playerid] != 1337) return 0;
    if(
sscanf(params"u"id)) return SendClientMessage(playerid, -1"USAGE: adpil [playerid]");
    if(!
IsPlayerConnected(id)) return 0;
    if(
PlayerLevel[id] == 200) return SendClientMessage(playerid, -1"Player is already pilot");
    
format(stringsizeof(string), "Server Admin has made player %s a War Pilot."pname);
         
SendClientMessageToAll(Bluestring);
          
SendClientMessage(idBlue"Server Admin has given you Pilot Status. You can now fly the Rustlers!");
          
IRC_Say(gGroupIDIRC_CHANNELstring);
    
PlayerLevel[id] = 200;
    
TextDrawHideForPlayer(playeridhimessage);
    
format(stringsizeof(string), "Level:%d"PlayerLevel[playerid]);
        
TextDrawSetString(himessagestring);
        
TextDrawShowForPlayer(playeridhimessage);
        
    return 
1;

Re-done, untested.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)