How to add DMG to weapon
Hello!
I made a shop for my server and i put there GOLDEN Ak47, if you buy it from shop i want that it has more dmg than other weapons. Who can help, comment and ill pm you the code. |
Re: How to add DMG to weapon
If you wish to receive any help, then post your code here.
|
Re: How to add DMG to weapon
Help me please:)
Code:
#include <amxmodx> |
Re: How to add DMG to weapon
1 Attachment(s)
Code:
if(is_user_alive(id))Also, if you want to stop the function, use else after the check, or return something inside it, so the function will stop. It's better to use the item variable, instead of getting menu info. Just make a PHP Code:
Now, on the thread. You should register Ham_TakeDamage like this: PHP Code:
Like this: PHP Code:
Also, you may register cvars in variables, so it'll be more easy to use them. And it's better to use get_pcvar_num instead of get_cvar_num, because it's faster. And you may use read_data(2) in CurWeapon event insted of get_user_weapon, because I think it's more proper. In the function of the menu, where you give the golden ak47, you don't actually give it to him, but only check if he already has one. So you will have to give_item(id, "weapon_ak47") and then there is no need to check if he already has one, because you gave him. Otherwise, what if he hasn't got ak47? No sense. I'm not really sure if giving the item will automaticaly switch to it, but I think so. In the menu, you don't have to addblank 0 and then switch it and destroy the menu there. Just use that check in the handlers and it's all okay. PHP Code:
|
Re: How to add DMG to weapon
Thanks! Im Smarter now:D
|
| All times are GMT -4. The time now is 09:39. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.