For now you can add three lines at the top of it:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
#if defined OnPlayerCommandReceived
if (!OnPlayerCommandReceived(playerid, cmdtext)) return 1;
#endif
...
}
and an example:
pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
if (!gPlayer_LoggedIn[playerid]) return 0;
return 1;
}
For certain commands, use strcmp + length parameter of it to compare only the command's name and ignore
params.
Something last I forgot:
pawn Код:
#if defined OnPlayerCommandReceived
forward OnPlayerCommandReceived(playerid, cmdtext[]);
#endif
@SickAttack: Add
isnull macro too. What about the two callbacks to provide "cmd" and "params" parameters instead of "cmdtext"?