AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Message call originations (https://forums.alliedmods.net/showthread.php?t=64998)

Vet 12-29-2007 11:40

Message call originations
 
Here's a quickie. Where do the 1st server commands amx_imessage and amx_scrollmsg originate from?

kp_uparrow 12-29-2007 18:00

Re: Message call originations
 
you mean what plugin registered these commands?

amx_imessage is from imessage.amxx
amx_scrollmsg is from scrollmsg.amxx

Vet 12-29-2007 21:33

Re: Message call originations
 
No, I mean where/how do they get called the very first time. The imessages plugin init is:
Code:


public plugin_init()
{
    register_plugin("Info. Messages", AMXX_VERSION_STR, "AMXX Dev Team")
    register_dictionary("imessage.txt")
    register_dictionary("common.txt")
    register_srvcmd("amx_imessage", "setMessage")
    register_cvar("amx_freq_imessage", "30")
 
 
    new lastinfo[8]
    get_localinfo("lastinfomsg", lastinfo, 7)
    g_Current = str_to_num(lastinfo)
    set_localinfo("lastinfomsg", "")
}

I see its called from within the plugin with a task in the setMessage routine after the first call. But I can't figure out where or how the first amx_imessage command is called. And the amx_scrollmsg is the same way. Its no big deal, I'm just wondering.

kp_uparrow 12-30-2007 03:12

Re: Message call originations
 
well:

amxx.cfg
calls amx_imessage
calls setMessage
inside it sets task if not exists: set_task(freq_im, "infoMessage", 12345)


i bet scrollmsg does the same thing

Vet 12-30-2007 10:51

Re: Message call originations
 
I was under the impression that amxx.cfg got executed before any of the plugin's were initialize. So the register_srvcmd wouldn't be valid at that time. Thus you'd need to call amx_imessage and amx_scrollmsg from somewhere else after the 2 plugins were initialized. Also the initializing of the different imessages need to get into imessage's g_Messages[MAX_MESSAGES][384] array somehow. This must be accomplished somewhere else.

kp_uparrow 12-30-2007 16:54

Re: Message call originations
 
amxx.cfg is called after all plugins are loaded

getting into the array has a loop variable that loops through the array everytime infoMessage is called

Vet 12-30-2007 21:38

Re: Message call originations
 
Quote:

Originally Posted by kp_uparrow (Post 568360)
amxx.cfg is called after all plugins are loaded

That explains it. All this time I tought it was executed before plugins.
Thanx


All times are GMT -4. The time now is 11:07.

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