Weapons problem
#9

You must delete this value of the variable if the weapon is empty.
Put this into OnPlayerWeaponShot:
PHP код:
new Waffe[7],Ammo[8];
for(new 
i;i<12;i++)
{
    if(
10 && > -1)
    {
        
format(Waffe,sizeof Waffe,"pGun0%i",i);
        
format(Ammo,sizeof Ammo,"pAmmo0%i",i);
    }
    else if(
>= 10)
    {
        
format(Waffe,sizeof Waffe,"pGun%i",i);
        
format(Ammo,sizeof Ammo,"pAmmo%i",i);
    }
    if(
PlayerInfo[playerid][Waffe] == weaponid)
    {
        if(
PlayerInfo[playerid][Ammo] > 0)
        {
            
PlayerInfo[playerid][Ammo] --;
        }
        if(
PlayerInfo[playerid][Ammo] == 0)
        {
            
PlayerInfo[playerid][Ammo] = 0;
            
PlayerInfo[playerid][Waffe] = 0;
        }
    }

Maybe it is not the best solution but it work.
Reply


Messages In This Thread
Weapons problem - by benjaminjones - 01.09.2015, 06:14
Re: Weapons problem - by Sanady - 01.09.2015, 06:19
Re: Weapons problem - by benjaminjones - 01.09.2015, 06:32
Re: Weapons problem - by Evocator - 01.09.2015, 07:11
Re: Weapons problem - by benjaminjones - 01.09.2015, 08:11
Re: Weapons problem - by MarvinPWN - 01.09.2015, 08:40
Re: Weapons problem - by benjaminjones - 01.09.2015, 09:28
Re: Weapons problem - by Evocator - 01.09.2015, 09:44
Re: Weapons problem - by MarvinPWN - 01.09.2015, 09:50
Re: Weapons problem - by benjaminjones - 02.09.2015, 05:29

Forum Jump:


Users browsing this thread: 2 Guest(s)