SA-MP Forums Archive
warning 202: number of arguments does not match definition - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: warning 202: number of arguments does not match definition (/showthread.php?tid=453578)



warning 202: number of arguments does not match definition - DanishHaq - 25.07.2013

So, the command basically, when you do [/dl] you can see a car's vehicle ID, and then /rveh <carid> will respawn the car. That works fine, but when I do the SendClientMessage to that person who used the command, it comes up with this error:

Quote:

(14055) : warning 202: number of arguments does not match definition

And in the game it just comes up with "SERVER: Unknown command", but it will still respawn the vehicle.

He's the code:

pawn Код:
if(strcmp(cmd, "/rveh", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] >= 1)
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_SYNTAX, "Syntax: /rveh [vehid]");
                    return 1;
                }
                new carid;
                carid = strval(tmp);
                {
                    format(string, sizeof(string), "Vehicle ID %d was respawned.", carid);
                    SendClientMessage(playerid, COLOR_WHITE); // LINE 14055
                    SetVehicleToRespawn(carid);
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_ERROR, "NOTADMIN");
            }
        }
    }



Re: warning 202: number of arguments does not match definition - ScRipTeRi - 25.07.2013

pawn Код:
if(strcmp(cmd, "/rveh", true) == 0)
    {
        if(IsPlayerConnected(playerid))
            {
              if(PlayerInfo[playerid][pAdmin] >= 1)
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_SYNTAX, "Syntax: /rveh [vehid]");
                    return 1;
                }
                new carid;
                carid = strval(tmp);
                {
                    format(string, sizeof string, "Vehicle ID %d was respawned.", carid);
                    SendClientMessage(string, COLOR_WHITE); // LINE 14055
                    SetVehicleToRespawn(carid);
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_ERROR, "NOTADMIN");
            }
        }
        }



Re: warning 202: number of arguments does not match definition - JimmyCh - 25.07.2013

Fixed here:
pawn Код:
if(strcmp(cmd, "/rveh", true) == 0)
{
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] >= 1)
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_SYNTAX, "Syntax: /rveh [vehid]");
                    return 1;
                }
                new carid;
                carid = strval(tmp);
                {
                    format(string, sizeof(string), "Vehicle ID %d was respawned.", carid);
                    SendClientMessage(playerid, COLOR_WHITE, string); // LINE 14055
                    SetVehicleToRespawn(carid);
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_ERROR, "NOTADMIN");
            }
        }
        return 1;
}

EDIT: @The guy above me, do you even know what you did? You did nothing, he was missing the string to send at SendClientMessage, and about the error message, it's because he had a missing return 1; what did you post?!


Re: warning 202: number of arguments does not match definition - DanishHaq - 25.07.2013

ScRipTeRi - that's wrong...
JimmyCh - Thanks. I totally didn't notice the fact that I didn't do SendClientMessage(playerid, COLOR, string).

.