13.04.2011, 14:00
Howdy. Well since the stupid SetPlayerAmmo function isn't working I've managed to make somethimg simliar. Anyways when a player enters the car with a Tech 9, UZI, or MP5, it will set their ammo to -60 -30. Everything works great on this little system that I'm making. Everything accept for if I enter the car with another gun in my hand, then the function i made does not take effect..
For Example. If I have an MP5 in my hand, and I get into a car as the Driver. Then the ammo will get set to -60-30. But if I have an MP5 on me, and I enter the car with my fist, or a desert eagle, or another weapon in general. Then the function will not take effect.
Can anyone help me fix this? Or tell me why it isn't working how I want it to...?
For Example. If I have an MP5 in my hand, and I get into a car as the Driver. Then the ammo will get set to -60-30. But if I have an MP5 on me, and I enter the car with my fist, or a desert eagle, or another weapon in general. Then the function will not take effect.
Can anyone help me fix this? Or tell me why it isn't working how I want it to...?
pawn Код:
new gun = GetPlayerWeapon(playerid), ammo = 0-30;
if(gun == 28 || gun == 29 || gun == 32)
{
RemovePlayerWeapon(playerid, gun);
GivePlayerWeapon(playerid, gun, ammo);
}