SA-MP Forums Archive
how to make guns not unlimited? Roleplay - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: how to make guns not unlimited? Roleplay (/showthread.php?tid=561022)



how to make guns not unlimited? Roleplay - Samieastwood - 31.01.2015

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


Re: how to make guns not unlimited? Roleplay - Fredx - 31.01.2015

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);


Re: how to make guns not unlimited? Roleplay - CalvinC - 31.01.2015

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.


Re: how to make guns not unlimited? Roleplay - Samieastwood - 31.01.2015

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

this is for /sellgun


Re: how to make guns not unlimited? Roleplay - Trevor Gin - 31.01.2015

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



Re: how to make guns not unlimited? Roleplay - Abagail - 31.01.2015

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).