error argument ...
#1

pawn Код:
CMD:giveweapon(playerid,params[])
{
        if(pInfo[playerid][Adminlevel] < 4) return SCM(playerid, COLOR_RED,""ERROR_MESSAGE"");
        new TargetID,targetname[50],weaponname[50],weaponammo;
        if(sscanf(params,"us[50]d",TargetID,weaponname,weaponammo)) return SCM(playerid, COLOR_RED, "Usage: /giveweapon [playerid] [weapon id/weapon name] [ammo]");
        new string[128],weapon[50],wea;
        GetPlayerName(TargetID,targetname,sizeof(TargetID));
        if(!isNumeric(weaponname))
        {
            wea = GetWeaponIDFromName(weaponname);
            GetWeaponName(wea,weapon,50);
        }
        else
        {
            wea = GetWeaponName(weaponname,weapon,50);
        }
        if(IsPlayerConnected(TargetID) && TargetID != INVALID_PLAYER_ID)
        {
            if(!IsValidWeapon(wea)) return SCM(playerid,COLOR_RED,"Invalid Weapon ID or Name");
            format(string, sizeof(string), "**Weapon: %s (%d) (Admin Weapon) %s (%d) with %d rounds of ammo", targetname,TargetID, weapon, wea, weaponammo); SCMA(COLOR_HOTPINK,string);
            return GivePlayerWeapon(TargetID, wea, weaponammo);
        } else return SCM(playerid,COLOR_RED,"** Player is not connected");
}
pawn Код:
(9425) : error 035: argument type mismatch (argument 1)
line 9425
pawn Код:
wea = GetWeaponName(weaponname,weapon,50);
Reply


Messages In This Thread
error argument ... - by AroseKhanNiazi - 09.05.2014, 15:22
Re: error argument ... - by Sithis - 09.05.2014, 15:26
Re: error argument ... - by AroseKhanNiazi - 09.05.2014, 15:27
Re: error argument ... - by Konstantinos - 09.05.2014, 15:39
Re: error argument ... - by AroseKhanNiazi - 09.05.2014, 15:56
Re: error argument ... - by Konstantinos - 09.05.2014, 15:57
Re: error argument ... - by AroseKhanNiazi - 09.05.2014, 16:01
Re: error argument ... - by Konstantinos - 09.05.2014, 16:07
Re: error argument ... - by AroseKhanNiazi - 09.05.2014, 16:15
Re: error argument ... - by Konstantinos - 09.05.2014, 16:18

Forum Jump:


Users browsing this thread: 1 Guest(s)