01.11.2016, 13:11
Having your OnGameModeInit hooked with y_hooks will cause the following example:
To malfunction. It will not detect ANY command. But I figured that's supposed to happen.
And having i = GetTotalCommandCount() will detect an extra non-existing command with flag:
and no name.
fixes that. I thought it was worth mentioning.
PHP код:
public OnGameModeInit()
{
for(new i = GetTotalCommandCount(); i >=0; i--)
{
new flags = GetCommandFlags(i);
if(flags & ACMD1) AdminLevel[i] = 1;
else if(flags & ACMD2) AdminLevel[i] = 2;
else if(flags & ACMD3) AdminLevel[i] = 3;
else if(flags & ACMD4) AdminLevel[i] = 4;
else if(flags & ACMD5) AdminLevel[i] = 5;
}
}
And having i = GetTotalCommandCount() will detect an extra non-existing command with flag:
Код:
11111111111111111111111111111111
PHP код:
for(new i = (GetTotalCommandCount() - 1); i >= 0; i--)