Raised This Month: $18 Target: $400
 4% 

[HELP] Golden deagle with less dmg to get ammo pack


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mankled
Member
Join Date: Oct 2019
Old 10-29-2019 , 12:45   [HELP] Golden deagle with less dmg to get ammo pack
Reply With Quote #1

can someone make this golden deagle to get ammo pack faster when player buys it.

example: on my server, i use this cvar zp_human_damage_reward on 1000. so i want that who buys golden deagle will have to take 500 dmg to get ammo packs and ignore/replace the main cvar "zp_human_damage_reward", basically it will change zp_human_damage_reward to 500 only to who buys it.(not to everybody in the server)
Attached Files
File Type: sma Get Plugin or Get Source (zp_extra_goldendg.sma - 29 views - 6.2 KB)

Last edited by Mankled; 11-01-2019 at 13:10.
Mankled is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 10-29-2019 , 14:46   Re: [HELP] Golden deagle with less dmg to get ammo pack
Reply With Quote #2

- Hook the death message event.
- Check if the player has bought a deagle (the g_HasDg cvar).
- Check if he used a deagle to kill the other player (read_data(4, ...))
- Use the ZP natives to give him double the cvar's amount of ammo packs (get_pcvar_num * 2).
__________________

Last edited by OciXCrom; 10-29-2019 at 14:48.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Mankled
Member
Join Date: Oct 2019
Old 10-29-2019 , 16:59   Re: [HELP] Golden deagle with less dmg to get ammo pack
Reply With Quote #3

I don't want to give ammo packs to him when he gets a kill with golden deag, I want to give ammo pack when the player does 500 dmg, and ignore the zp reward from main zp, so the main zp reward on my server is 1000. When he got 1000 dmg he should get 2 ammo packs 2500 from the deag and ignore +1 ammo pack from main plugin by the 1000 dmg that he did
Mankled is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 10-29-2019 , 18:22   Re: [HELP] Golden deagle with less dmg to get ammo pack
Reply With Quote #4

In that case:
- Hook the Ham_TakeDamage event.
- Check if the damage is done with a deagle and the player has bought a golden deagle.
- Add the amount of damage dealt in a global variable assigned to the attacker's id.
- Check if the amount of damage is >= 500. If it is -> give him the desired amount of ammo packs and substract 500 from the variable where you stored the damage.
- Instead of "ignoring" the +1 AP, simply give him +1 AP instead of +2?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Mankled
Member
Join Date: Oct 2019
Old 10-30-2019 , 00:39   Re: [HELP] Golden deagle with less dmg to get ammo pack
Reply With Quote #5

i just want to take the cvar "zp_human_damage_reward" from main zp plugin and set it to 500 only to players who has bought golden deag
Mankled is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 10-30-2019 , 05:36   Re: [HELP] Golden deagle with less dmg to get ammo pack
Reply With Quote #6

Then go ahead and modify the main plugin. You can create a native in this one and use it in the main plugin to check if the player has bought a deagle.
__________________

Last edited by OciXCrom; 10-30-2019 at 05:36.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Mankled
Member
Join Date: Oct 2019
Old 11-01-2019 , 01:08   Re: [HELP] Golden deagle with less dmg to get ammo pack
Reply With Quote #7

i couldn't do it. is there an other way to do it only in the zp_extra_goldendg.sma?
Mankled is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-01-2019 , 07:53   Re: [HELP] Golden deagle with less dmg to get ammo pack
Reply With Quote #8

The best way to do it is to edit the original source. Post what you have done so far.
__________________

Last edited by OciXCrom; 11-01-2019 at 07:53.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Mankled
Member
Join Date: Oct 2019
Old 11-01-2019 , 13:10   Re: [HELP] Golden deagle with less dmg to get ammo pack
Reply With Quote #9

Quote:
Originally Posted by Mankled View Post
can someone make this golden deagle to get ammo pack faster when player buys it.

example: on my server, i use this cvar zp_human_damage_reward on 1000. so i want that who buys golden deagle will have to take 500 dmg to get ammo packs and ignore/replace the main cvar "zp_human_damage_reward", basically it will change zp_human_damage_reward to 500 only to who buys it.(not to everybody in the server)
that's the original code, i didn't edit anything.
Attached Files
File Type: sma Get Plugin or Get Source (zp_extra_goldendg.sma - 14 views - 6.2 KB)

Last edited by Mankled; 11-01-2019 at 13:11.
Mankled is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-01-2019 , 14:25   Re: [HELP] Golden deagle with less dmg to get ammo pack
Reply With Quote #10

So you didn't even try? I gave you instructions. See what you can do and post the results.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:58.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode