SA-MP Forums Archive
Is it possible to give just a empty weapon, no ammo? - 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: Is it possible to give just a empty weapon, no ammo? (/showthread.php?tid=527837)



Is it possible to give just a empty weapon, no ammo? - Don_Cage - 24.07.2014

Like my title say, is it possible to make a cmd like /givegun and it will only give the gun, no ammo so you will get for example deagle but with 0 ammo.
Is this possible or will the weapon dissapear since it's out of ammo?


Re: Is it possible to give just a empty weapon, no ammo? - Blademaster680 - 24.07.2014

https://sampwiki.blast.hk/wiki/SetPlayerAmmo

With that you can set the player's ammo


Re: Is it possible to give just a empty weapon, no ammo? - Don_Cage - 24.07.2014

Well there it said right away that setting the ammo to 0 will remove the weapon..
But is there someone who made an include/plugin or something like that to make this work?


Re: Is it possible to give just a empty weapon, no ammo? - AIped - 24.07.2014

with a little bit of creative mind you could work around it and give the other player the object id (not the weaponid) instead of a weapon. So it would look like the other player has been given a weapon but in fact it is an attached object. If that player buys ammo the attached object/weapon could be replaced as its real weapon of the same model .

BUT...thats just an idea...


Edit: i have no knowledge of anyone making such an include


Re: Is it possible to give just a empty weapon, no ammo? - Beckett - 24.07.2014

No it's not possible.


Re: Is it possible to give just a empty weapon, no ammo? - AIped - 24.07.2014

Quote:
Originally Posted by DaniceMcHarley
Посмотреть сообщение
No it's not possible.
Yup..but if he realy want it he could try out the idea i posted.


Re : Is it possible to give just a empty weapon, no ammo? - S4t3K - 24.07.2014

Why being so crazy in your ideas ? (giving an empty model for example)

Just give a deagle with 1 ammo, put a variable on the player and then check under OnPlayerWeaponShot if the weaponid is deagle and if the player has the variable. If so, then just give one ammo back and if someone/thing was hit, refill the health.


Re: Re : Is it possible to give just a empty weapon, no ammo? - AIped - 24.07.2014

Quote:
Originally Posted by S4t3K
Посмотреть сообщение
Why being so crazy in your ideas ? (giving an empty model for example)

Just give a deagle with 1 ammo, put a variable on the player and then check under OnPlayerWeaponShot if the weaponid is deagle and if the player has the variable. If so, then just give one ammo back and if someone/thing was hit, refill the health.
Yea thats probably easyer ..well nvm the guy who started this topic can choose what to do now and thats why i replied in the first place.


Re: Re : Is it possible to give just a empty weapon, no ammo? - Don_Cage - 27.07.2014

Quote:
Originally Posted by S4t3K
Посмотреть сообщение
Why being so crazy in your ideas ? (giving an empty model for example)

Just give a deagle with 1 ammo, put a variable on the player and then check under OnPlayerWeaponShot if the weaponid is deagle and if the player has the variable. If so, then just give one ammo back and if someone/thing was hit, refill the health.
I like your idea but also I don't like the fact that they have "infinite ammo" even though the health of everything it hits get resetted..
Is there any chanse that you can detect if a player shoot and then stop him before the shot is fired?


Re: Is it possible to give just a empty weapon, no ammo? - Dignity - 27.07.2014

Or you can just apply a reloading animation every time LMB/RMB is clicked when having a weapon equipped, no need to complicate things.