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

register_message hook params


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-01-2017 , 09:54   register_message hook params
Reply With Quote #1

Can someone tell me what msg_id and msg_dest are actually ?

PHP Code:
register_message(get_user_msgid("Health"), "message_health")

public 
message_health(msg_idmsg_destmsg_entity
__________________

Last edited by Depresie; 09-01-2017 at 09:55.
Depresie is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 09-01-2017 , 10:30   Re: register_message hook params
Reply With Quote #2

Msg_ID - The ID of the message (people usually use get_user_msgid for it).
Msg_Dest - Is the destination net buffer. (MSG_* constants).
Msg_Entity - The entity ID it is sent to.
__________________
edon1337 is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-01-2017 , 13:48   Re: register_message hook params
Reply With Quote #3

Also any idea on this statement ?

PHP Code:
(health 256 == 0
__________________
Depresie is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 09-01-2017 , 13:54   Re: register_message hook params
Reply With Quote #4

% is the modulo (modulus) operator. It returns the remainder after division of two integers. That statement check if health is divisible by 256.
klippy is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 09-01-2017 , 20:34   Re: register_message hook params
Reply With Quote #5

Are you looking into ZP code?
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-02-2017 , 07:37   Re: register_message hook params
Reply With Quote #6

Yeah, i'm working for some time on a new version of zombie plague
__________________
Depresie is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 09-02-2017 , 07:43   Re: register_message hook params
Reply With Quote #7

This code is redundant:
Code:
    // Check if we need to fix it     if (health % 256 == 0)         fm_set_user_health(msg_entity, pev(msg_entity, pev_health) + 1)
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
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 20:21.


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