AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Golden deagle with less dmg to get ammo pack (https://forums.alliedmods.net/showthread.php?t=319400)

Mankled 10-29-2019 12:45

[HELP] Golden deagle with less dmg to get ammo pack
 
1 Attachment(s)
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)

OciXCrom 10-29-2019 14:46

Re: [HELP] Golden deagle with less dmg to get ammo pack
 
- 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).

Mankled 10-29-2019 16:59

Re: [HELP] Golden deagle with less dmg to get ammo pack
 
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 2×500 from the deag and ignore +1 ammo pack from main plugin by the 1000 dmg that he did

OciXCrom 10-29-2019 18:22

Re: [HELP] Golden deagle with less dmg to get ammo pack
 
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?

Mankled 10-30-2019 00:39

Re: [HELP] Golden deagle with less dmg to get ammo pack
 
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

OciXCrom 10-30-2019 05:36

Re: [HELP] Golden deagle with less dmg to get ammo pack
 
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.

Mankled 11-01-2019 01:08

Re: [HELP] Golden deagle with less dmg to get ammo pack
 
i couldn't do it. is there an other way to do it only in the zp_extra_goldendg.sma?

OciXCrom 11-01-2019 07:53

Re: [HELP] Golden deagle with less dmg to get ammo pack
 
The best way to do it is to edit the original source. Post what you have done so far.

Mankled 11-01-2019 13:10

Re: [HELP] Golden deagle with less dmg to get ammo pack
 
1 Attachment(s)
Quote:

Originally Posted by Mankled (Post 2671332)
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.

OciXCrom 11-01-2019 14:25

Re: [HELP] Golden deagle with less dmg to get ammo pack
 
So you didn't even try? I gave you instructions. See what you can do and post the results.


All times are GMT -4. The time now is 01:13.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.