SA-MP Forums Archive
small warning - 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: small warning (/showthread.php?tid=442146)



small warning - DetoNater - 06.06.2013

Small warning,

pawn Код:
CMD:fixpv(playerid, params[])
{
        if(aDuty[playerid] == 1)
        if(PlayerInfo[playerid][pAdmin] >= 2)
        {
        new targetid;
        if(sscanf(params, "ui", targetid)) return SendClientMessage(playerid, C_GREY, "USAGE: /fixpv [playerid]");
        if(!IsPlayerInAnyVehicle(targetid)) return SendClientMessage(playerid,C_RED,"SERVER: Player not in a vehicle.");
        RepairVehicle(GetPlayerVehicleID(targetid));
       
        SendClientMessage(targetid, C_LGREEN, "Your Vehicle has been fixed by Admin %s ", Name(playerid));// here comes a warn
        } else SendClientMessage(playerid,C_RED,"You are not authorized to use this command!");
        return 1;
}
Код:
D:\GTA SanAndreas\_Samp_\gamemodes\iBon_BF.pwn(3748) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.



Re: small warning - KickInTheMick - 06.06.2013

pawn Код:
CMD:fixpv(playerid, params[])
{
        if(aDuty[playerid] == 1)
        if(PlayerInfo[playerid][pAdmin] >= 2)
        {
        new targetid, string[128];
        if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, C_GREY, "USAGE: /fixpv [playerid]");
        if(!IsPlayerInAnyVehicle(targetid)) return SendClientMessage(playerid,C_RED,"SERVER: Player not in a vehicle.");
        RepairVehicle(GetPlayerVehicleID(targetid));
        format(string, sizeof(string), "Your Vehicle has been fixed by Admin %s ", Name(playerid));
        SendClientMessage(targetid, C_LGREEN, string);
        } else SendClientMessage(playerid,C_RED,"You are not authorized to use this command!");
        return 1;
}



Re: small warning - Johanson24 - 06.06.2013

You don't need the "ui" all you need is the "u" because your only filling in the ID.