Detecting ammo.
#4

pawn Код:
if(itemid == ITEM_COLT45CLIP) {
        new ammo;
        GetPlayerWeaponData(playerid, 2, ammo, ammo);//ammo is set last
        if(ammo > 1) return SendClientMessage(playerid, -1, "You already have colt45 ammo?");
        RemoveItemFromPlayerInventory(playerid, ITEM_COLT45CLIP, 1);

        GivePlayerWeapon(playerid,22, 17);
        ApplyAnimationEx(playerid, "SILENCED", "Silence_reload", 3.0, 0, 0, 0, 0, 0);

        SendClientMessage(playerid, COLOR_GREEN, "You have taken a COLT45 clip from your inventory & reloaded your weapon.");
        return 1;
    }
Quote:
Originally Posted by AndreT
Посмотреть сообщение
Edit
Why not also use the function GetPlayerWeaponState and check:
pawn Код:
if(GetPlayerWeaponState(playerid) == WEAPONSTATE_NO_BULLETS)
// same as
if(!GetPlayerWeaponState(playerid))
I don't think he wants it for his "current" weapon holding, maybe the colt45 is in his just in his ammo rack (metaphor)
Reply


Messages In This Thread
Detecting ammo. - by Darnell - 30.08.2011, 15:09
Re: Detecting ammo. - by [MWR]Blood - 30.08.2011, 15:13
Re: Detecting ammo. - by AndreT - 30.08.2011, 15:13
Re: Detecting ammo. - by Kar - 30.08.2011, 15:16
Re: Detecting ammo. - by Darnell - 30.08.2011, 15:27

Forum Jump:


Users browsing this thread: 1 Guest(s)