Gun ammo
#1

Hey,this supposed to give a player 50 extra bullets but it isn't working somehow, not sure what I did wrong but any help is appreciated.
pawn Код:
new gunid = GetPlayerWeapon(playerid);
new ammo;
GetPlayerWeaponData(playerid, gunid, ammo);
SetPlayerAmmo(playerid, gunid, ammo+50);
Reply
#2

remove
Код:
 = GetPlayerWeapon(playerid);
and try, not sure if that's correct, but try

Because you're using gunid in two funtions.
Reply
#3

I tried it but I'm getting the same results, also I want to add the 50 bullets to the weapon he is currently holding.
Reply
#4

pawn Код:
new ammo = GetPlayerAmmo(playerid);
Reply
#5

Lol, you're all wrong.

Just use:

pawn Код:
GivePlayerWeapon(playerid, GetPlayerWeapon(playerid), 50);
Reply
#6

Quote:
Originally Posted by Emmet_
Посмотреть сообщение
Lol, you're all wrong.

Just use:

pawn Код:
GivePlayerWeapon(playerid, GetPlayerWeapon(playerid), 50);
Jimmy solved my problem, thank you for that. Emmet, you're the one thats wrong you just replace the players weapon with 50 bullets but what if the person had already a 100 bullets in his gun? Thats what I needed help for, thanks anyway.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)