Raised This Month: $32 Target: $400
 8% 

Solved Message ID return 0


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ConorCC
Member
Join Date: Feb 2014
Old 01-02-2021 , 04:35   Message ID return 0
Reply With Quote #1

The main question is "How can we get a message's ID in plugin_precache?"

After the first initialization
Code:
get_user_msgid("WeaponList")
returns 0 in plugin_precache.

This message should be caught in plugin_precache because it will be send before the plugin_init. So if you want to log the arguments of this one you should do it in the here.

It's all right but whenever I start or restart the server this message ID will be returned as 0, after the first changelevel everything is fine, I got the expected message ID (7.

After I coding for myself I will store this ID staticly in my pugins but if someone has any useful idea we can check this out.

Last edited by ConorCC; 01-02-2021 at 09:31. Reason: Solved
ConorCC is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-02-2021 , 07:35   Re: Message ID return 0
Reply With Quote #2

https://forums.alliedmods.net/showthread.php?p=2607132

https://www.amxmodx.org/api/amxmodx/get_user_msgid

Quote:
Note

On first server start, this function will return 0 if used inside
plugin_precache(). Consider hooking RegUserMsg in order to retrieve
the correct message id.
__________________

Last edited by OciXCrom; 01-02-2021 at 07:35.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
ConorCC
Member
Join Date: Feb 2014
Old 01-02-2021 , 09:31   Re: Message ID return 0
Reply With Quote #3

Thank you for the info.
I feel so stupid because of I ignored this point in the documentation.
ConorCC 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 23:23.


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