Weapons
#1

This is very annoyning: for example, I have a shotgun with 500 bullets. Then, I get 1 sawn-off bullet et voila - I have 501 sawn off bullets. Any solutions? I think its something to do with weap slots :3
Reply
#2

change the amount of ammo when giving new weapon, and if you have to subtract from current ammo.
Reply
#3

Well, if you mean that you are wanting 500 spawn off bullets after switching from a standard shotgun, it is rather simple...

This should work, although I have no tested it...

Код:
{
	ResetPlayerWeapons(playerid);
	return 1;
}

{
        AC_GivePlayerWeapon(playerid, 26, 500);
        return 1;
}
Reply
#4

Quote:
Originally Posted by nmader
Посмотреть сообщение
Well, if you mean that you are wanting 500 spawn off bullets after switching from a standard shotgun, it is rather simple...

This should work, although I have no tested it...

Код:
{
	ResetPlayerWeapons(playerid);
	return 1;
}

{
        AC_GivePlayerWeapon(playerid, 26, 500);
        return 1;
}
NONO, you didn't understood what do I need :^

Medardo4Life: Can't understand :3
Reply
#5

Well then, specify further what you need?
Reply
#6

Okay, there's "better" example:


I have 500 AK-47 bullets. Then, by using GivePlayerWeapon I get 1 M4 bullet. After that, instead of having 1 M4 bullet, I have 501 M4 bullets = its mixing?.. So, I need a "function" which would fix that, I mean in this situation I would have 1 m4 bullet, not 501
Reply
#7

Use this:
pawn Код:
Real_GivePlayerWeapon(playerid, weaponid, ammo)
{
    new weapons[2][13];

    for(new i = 0; i < 13; i++)
    {
        GetPlayerWeaponData(playerid, i, weapons[0][i], weapons[1][i]);
        if(weapons[0][i] == weaponid)
        {
            GivePlayerWeapon(playerid, weaponid, -weapons[1][i]);
            GivePlayerWeapon(playerid, weaponid, ammo);
            return 1;
        }
    }
    GivePlayerWeapon(playerid, weaponid, ammo);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)