How to modified the damage type of a gun?
if i use the following code in the hooked even "player_hurt", the vitim will first will be hurted by a normal damage type (damge type =2 if he is hurted by a gun), then followed by a specified damage type. How can i just replaced the first shoot in stead of add the second added shoot?
PHP Code:
|
Re: How to modified the damage type of a gun?
no one?
|
Re: How to modified the damage type of a gun?
Not possible, when the "player_hurt" event is fired, the victim has already been damaged. Try healing the victim and attacking it again?
Try hooking it before it happens (EventHookMode_Pre) and see if you can block the damage. But im pretty sure isn't possible. Also, if you don't want 2 hist at the same time, try doing this: Code:
new client = GetClientOfUserId(GetClientInt(event, "userid")); |
Re: How to modified the damage type of a gun?
If you did use hook event you would use the pre hook
PHP Code:
|
Re: How to modified the damage type of a gun?
You could just use SDKHooks's OnTakeDamage and change the damage type
|
Re: How to modified the damage type of a gun?
Quote:
|
Re: How to modified the damage type of a gun?
Using the normal player_hurt event won't work. As most have said, even if this uses the EventHookeMode_Pre, it won't fire in time for the plugin to stop the players death. You could only stop the deathmessage, and perhaps heal up but that I doubt.
noodleboy's right, you should use SDKHooks' OnTakeDamage, which can be modified in many ways. |
Re: How to modified the damage type of a gun?
Quote:
|
All times are GMT -4. The time now is 19:15. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.