sscanf warning
#1

Hello guys!

I was testing a simple command "/adnos" but when i was checking the console, i got a warning:

Quote:

sscanf warning: format specifier does not match parameter count.

PHP код:
dcmd_adnos(playerid,params[])
{
    new 
string[128];
    new 
ID;
    if(
sscanf(params,"us[100]",ID))
    {
        
SendClientMessage(playerid,COLOR_NUB,"USAGE: /adnos (Player Name/ID)");
        return 
1;
    }
    if(
IsSpawned[playerid] != 1)
    {
        
SendClientMessage(playerid,COLOR_NUB,"[ERROR]{FFFFFF}You must be spawned. Otherwise, you can't type this command.");
        return 
1;
    }
    if(!
IsPlayerInAnyVehicle(ID))
    {
        
SendClientMessage(playeridCOLOR_NUB"That player is not in a car, you cannot give him/her nos!");
        return 
1;
    }
    if(!
IsPlayerConnected(ID))
    {
        
format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot give him nos.",ID);
        
SendClientMessage(playerid,COLOR_NUB,string);
        return 
1;
    }
    
AddVehicleComponent(GetPlayerVehicleID(ID), 1010);
    
SendClientMessage(playerid,COLOR_YELLOW"[[_NOS_]] You have added nos to his/her car!");
    return 
1;

What does that mean?
Reply
#2

Well, your command uses only one parameter (player id) though you are defining two in the sscanf line (u - a player, and s - a string that you have not used). Try removing the 's[100]' from
pawn Код:
if(sscanf(params,"us[100]",ID))
Reply
#3

Thanks dude
+rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)