Weapon Ammo Textdraw
#5

Just this is enough:
pawn Код:
public OnPlayerChangeWeapon(playerid, oldweapon, newweapon)
{
    new clipsize = 0, string[7], leftammo = 0;
   
    switch(newweapon)//set the value according to the guns clipsizes!
    {
        case 27: clipsize = 7;//for spas12
    }
   
    if((GetPlayerAmmo(playerid) - clipsize) >= clipsize)//if the ammo is more than or equal that of clipsize
    {
        leftammo = (GetPlayerAmmo(playerid) - clipsize);
        format(string, sizeof(string), "%d - %d", clipsize, leftammo);
    }
    else//if the ammo is less than clip size
    {
        format(string, sizeof(string), "%d", GetPlayerAmmo(playerid));
        leftammo = 0;
    }
   
    PlayerTextDrawSetString(playerid, txt[playerid], string);
    return 1;
}
Reply


Messages In This Thread
Weapon Ammo Textdraw - by De4dpOol - 12.04.2015, 07:45
Re: Weapon Ammo Textdraw - by R0 - 12.04.2015, 07:49
Re: Weapon Ammo Textdraw - by De4dpOol - 12.04.2015, 08:16
Re: Weapon Ammo Textdraw - by R0 - 12.04.2015, 08:57
Re: Weapon Ammo Textdraw - by Gammix - 12.04.2015, 09:08

Forum Jump:


Users browsing this thread: 3 Guest(s)