help with weapon ammo
i want the gun in my hide n seek server when u start with it u have a random chance to get a gun.. i want to make it so u can only have 1 bullet..
for example.. i have a deagle.. i want it to have 1 bullet.. but when i spawn with it. i have 7 bullets and 1 ammo (7/1) i just want it to be 1/0 this is what i have been putting EVERYTHING works perfect.. i just want it to have 1 ammo.. for any gun i choose.. like deagle PHP Code:
|
Re: help with weapon ammo
cs_set_weapon_ammo(...) To set the ammo clip for weapons.
|
Re: help with weapon ammo
NOTE: You will have to find the weapon entity, not just weapon index / player index.
There might be a better way, but I tend to find entity by classname for the right weapon, and find the one whose owner is the player you want to do it for. |
Re: help with weapon ammo
A little stock to get the weapon entity num.
Code:
stock fm_get_weapon_id(index, const weapon[]);) |
Re: help with weapon ammo
Quote:
PHP Code:
PHP Code:
|
Re: help with weapon ammo
Copy that stock from my post above, "stock fm_get_weapon_id(index, const weapon[])", in your plugin at the end , and yes, after you give the deagle put this
Code:
cs_set_weapon_ammo(fm_get_weapon_id(id, weapon_deagle), 1); |
Re: help with weapon ammo
if(random_num(0, 100) <= 5)
This is actually prox 5.95%. ( 0, 1, 2, 3, 4, 5 ) out of ( 0 - 100 wich is total 101 ) change 0 to 1. |
Re: help with weapon ammo
still doesnt work.. i did what u said and i get these errors
/home/groups/amxmodx/tmp3/text88lMoz.sma(32) : error 017: undefined symbol "id" /home/groups/amxmodx/tmp3/text88lMoz.sma(32) : error 017: undefined symbol "weapon_awp" /home/groups/amxmodx/tmp3/text88lMoz.sma(32) : error 029: invalid expression, assumed zero /home/groups/amxmodx/tmp3/text88lMoz.sma(32) : fatal error 107: too many error messages on one line Compilation aborted. 4 Errors. Code:
#include <amxmodx> |
Re: help with weapon ammo
Code:
|
Re: help with weapon ammo
/home/groups/amxmodx/tmp3/textDcmDGN.sma(96) : error 017: undefined symbol "wpnId"
/home/groups/amxmodx/tmp3/textDcmDGN.sma(96) : error 017: undefined symbol "wpnId" |
| All times are GMT -4. The time now is 01:23. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.