Raised This Month: $51 Target: $400
 12% 

Hook OnTakeDamage, but in other ways..?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 06-05-2019 , 12:24   Hook OnTakeDamage, but in other ways..?
Reply With Quote #1

hey, i know i can hook OnTakeDamage like:

PHP Code:
public void OnClientPutInServer(int client)
{
    
SDKHook(clientSDKHook_OnTakeDamageHook_OnTakeDamage);
}

public 
Action Hook_OnTakeDamage(int victimintattackerintinflictorfloatdamageintdamagetype)
{
    ...
    
PrintToChat(client"You got damaged"); // <-- example
    
...

but is it posible to Hook it on OnPlayerRunCmdPost?

Last edited by iskenderkebab33; 06-05-2019 at 12:25.
iskenderkebab33 is offline
Kolapsicle
Senior Member
Join Date: Oct 2014
Old 06-05-2019 , 17:05   Re: Hook OnTakeDamage, but in other ways..?
Reply With Quote #2

Yes, but you should be mindful not to hook the same entity more than once.
Kolapsicle is offline
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 06-05-2019 , 17:48   Re: Hook OnTakeDamage, but in other ways..?
Reply With Quote #3

Quote:
Originally Posted by Kolapsicle View Post
Yes, but you should be mindful not to hook the same entity more than once.
and how can i do that?
iskenderkebab33 is offline
Kolapsicle
Senior Member
Join Date: Oct 2014
Old 06-05-2019 , 19:55   Re: Hook OnTakeDamage, but in other ways..?
Reply With Quote #4

The same way as in your example.

PHP Code:
public void OnPlayerRunCmdPost(int client)
{
    
// This will create endless hooks on the client - not a good idea as is
    
SDKHook(clientSDKHook_OnTakeDamageHook_OnTakeDamage);

Kolapsicle is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 06-05-2019 , 23:18   Re: Hook OnTakeDamage, but in other ways..?
Reply With Quote #5

Quote:
Originally Posted by iskenderkebab33 View Post
but is it posible to Hook it on OnPlayerRunCmdPost?
What is the point of doing this?
__________________
8guawong is offline
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 06-06-2019 , 09:27   Re: Hook OnTakeDamage, but in other ways..?
Reply With Quote #6

Quote:
Originally Posted by Kolapsicle View Post
The same way as in your example.

PHP Code:
public void OnPlayerRunCmdPost(int client)
{
    
// This will create endless hooks on the client - not a good idea as is
    
SDKHook(clientSDKHook_OnTakeDamageHook_OnTakeDamage);

thanks.

Quote:
Originally Posted by 8guawong View Post
What is the point of doing this?
if the player hold +duck he will be allow to do more damage on the enemy
iskenderkebab33 is offline
Reply



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 21:49.


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