zcmd - Confused??
#1

Well, I was reading on the include for zcmd 0.3.1 and noticed an odd function.

pawn Код:
public OnGameModeInit()
{
        zcmd_g_HasOPCS = funcidx("OnPlayerCommandReceived") != -1;
        zcmd_g_HasOPCE = funcidx("OnPlayerCommandPerformed") != -1;
        if (funcidx("zcmd_OnGameModeInit") != -1)
        {
                return CallLocalFunction("zcmd_OnGameModeInit", "");
       }      
        return 1;
}
What is this function funcidx and what does it do? I have searched the wiki also.
Reply
#2

Ok, I found that this belongs to core.inc


But still do not know what its used for.
Reply
#3

funcidx is probably "Function Index", but still, I don't know what it does either.
Reply
#4

funcidx returns ID of the specific public function. If it's not (-1) that function exists. Funcidx is fast, so zcmd firstly checks if public function actually exists before calling it with CallLocalFunction.
Reply
#5

Quote:
Originally Posted by Sergei
Посмотреть сообщение
funcidx returns ID of the specific public function. If it's not (-1) that function exists. Funcidx is fast, so zcmd firstly checks if public function actually exists before calling it with CallLocalFunction.
So if we don't have OnGameModeInit or OnPlayerCommand for example, it will not load or something?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)