how to make guns not unlimited? Roleplay
#1

So basically my script is already scripted for people to buy ammo etc. however all the guns they recieved are all unlimited. How can i make it no unlimited so they would have to buy ammo
Reply
#2

You'll have to set his ammo when he purchases a weapon, https://sampwiki.blast.hk/wiki/SetPlayerAmmo SetPlayerAmmo(playerid, weaponslot, GetPlayerAmmo(playerid));

This just adds up more ammo when the player already has a weapon with ammo in it.
new Ammo = GetPlayerAmmo(playerid);
SetPlayerAmmo(playerid, weaponslot, Ammo+3);
Reply
#3

When you use GivePlayerWeapon, you can select both weapon ID and ammo, just set the ammo that whatever you wish.
It will become unlimited if it's set to 99999 or more.
Reply
#4

is that unlimited? GivePlayerValidWeapon(playerid,weapon,60000); what can i change to make it normal

this is for /sellgun
Reply
#5

Код:
GivePlayerValidWeapon(playerid,weapon,150);
Reply
#6

60000 is the amount of ammo. NGRP / GF edits typically aren't made for ammunition. You'll need to replace every GivePlayerValidWeapon with the amount of 60000(or simply edit the stock to not give that amount).
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)