SA-MP Forums Archive
Warning issue - 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 issue (/showthread.php?tid=587949)



Warning issue - alexanderjb918 - 04.09.2015

Код:
C:\Users\ii\Documents\America's Army 3\roleplay.pwn(1167) : warning 202: number of arguments does not match definition
Код:
stock RemovePlayerWeapon(playerid, weaponid)
{
    SetPlayerArmedWeapon(playerid, weaponid);
    if (GetPlayerWeapon(playerid) != 0) GivePlayerWeapon(playerid, -(GetPlayerAmmo(playerid)));

    return 1;
}
Код:
 if (GetPlayerWeapon(playerid) != 0) GivePlayerWeapon(playerid, -(GetPlayerAmmo(playerid)));



Re: Warning issue - Fancy - 04.09.2015

Use this
Код:
stock RemovePlayerWeapon(playerid, weaponid)
{
    SetPlayerArmedWeapon(playerid, weaponid);
    if(GetPlayerWeapon(playerid) != 0) GivePlayerWeapon(playerid, weaponid, -(GetPlayerAmmo(playerid)));

    return 1;
}



Re: Warning issue - jlalt - 04.09.2015

PHP код:
GivePlayerWeapon(playeridweaponidammo); 
you just used [ GetPlayerAmmo(playerid); ] to know the ammo of weapon but you did not tell the script what is the weapon id