[Include] Command Processor [Faster Than I-ZCMD!]
#14

Quote:
Originally Posted by GoldenLion
Посмотреть сообщение
I have a question: how can I disable commands, like let's say I don't want players that are not logged in to use any commands. With ZCMD I could do it with OnPlayerCommandReceived, but I just found that this include doesn't have OnPlayerCommandReceived and I can't do it with OnPlayerCommandPerformed.
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"?
Reply


Messages In This Thread
Command Processor [Faster Than I-ZCMD!] - by SickAttack - 08.10.2016, 18:33
Re: Command Processor [Faster Than I-ZCMD!] - by GoldenLion - 08.10.2016, 19:04
Re: Command Processor [Faster Than I-ZCMD!] - by XBrianX - 08.10.2016, 19:31
Re: Command Processor [Faster Than I-ZCMD!] - by SickAttack - 08.10.2016, 19:47
Re: Command Processor [Faster Than I-ZCMD!] - by AndySedeyn - 08.10.2016, 19:50
Re: Command Processor [Faster Than I-ZCMD!] - by JaKe Elite - 08.10.2016, 21:48
Respuesta: Re: Command Processor [Faster Than I-ZCMD!] - by Unrea1 - 08.10.2016, 22:35
Re: Command Processor [Faster Than I-ZCMD!] - by Eoussama - 08.10.2016, 22:47
Re: Command Processor [Faster Than I-ZCMD!] - by SickAttack - 08.10.2016, 22:55
Re: Command Processor [Faster Than I-ZCMD!] - by Crayder - 08.10.2016, 22:58
Re: Command Processor [Faster Than I-ZCMD!] - by Stinged - 09.10.2016, 12:01
Re: Command Processor [Faster Than I-ZCMD!] - by Konstantinos - 09.10.2016, 12:08
Re: Command Processor [Faster Than I-ZCMD!] - by GoldenLion - 09.10.2016, 16:42
Re: Command Processor [Faster Than I-ZCMD!] - by Konstantinos - 09.10.2016, 16:58
Re: Command Processor [Faster Than I-ZCMD!] - by Eymeric69 - 09.10.2016, 18:42
Re: Command Processor [Faster Than I-ZCMD!] - by GoldenLion - 09.10.2016, 19:24
Re: Command Processor [Faster Than I-ZCMD!] - by SickAttack - 09.10.2016, 19:33
Re: Command Processor [Faster Than I-ZCMD!] - by jlalt - 09.10.2016, 19:50
Re: Command Processor [Faster Than I-ZCMD!] - by SickAttack - 09.10.2016, 20:05
Re: Command Processor [Faster Than I-ZCMD!] - by jlalt - 09.10.2016, 20:08
Re: Command Processor [Faster Than I-ZCMD!] - by SickAttack - 09.10.2016, 20:12
Re: Command Processor [Faster Than I-ZCMD!] - by SickAttack - 09.10.2016, 23:08
Re: Command Processor [Faster Than I-ZCMD!] - by SickAttack - 09.10.2016, 23:42
Re: Command Processor [Faster Than I-ZCMD!] - by Pottus - 10.10.2016, 00:59
Re: Command Processor [Faster Than I-ZCMD!] - by ]Kurence[ - 10.10.2016, 01:23
Re: Command Processor [Faster Than I-ZCMD!] - by Mutha_X - 10.10.2016, 04:55
Re: Command Processor [Faster Than I-ZCMD!] - by Yashas - 10.10.2016, 13:10
Re: Command Processor [Faster Than I-ZCMD!] - by SickAttack - 10.10.2016, 15:58
Re: Command Processor [Faster Than I-ZCMD!] - by Crystallize - 10.10.2016, 18:25
Re: Command Processor [Faster Than I-ZCMD!] - by SickAttack - 10.10.2016, 18:37
Re: Command Processor [Faster Than I-ZCMD!] - by DavidGravelli - 19.10.2016, 14:27
Re: Command Processor [Faster Than I-ZCMD!] - by HydraHumza - 22.10.2016, 07:39
Re: Command Processor [Faster Than I-ZCMD!] - by Yashas - 22.10.2016, 12:54
Re: Command Processor [Faster Than I-ZCMD!] - by Konstantinos - 22.10.2016, 13:06
Respuesta: Command Processor [Faster Than I-ZCMD!] - by Swedky - 23.10.2016, 08:45
Re: Command Processor [Faster Than I-ZCMD!] - by Yashas - 23.10.2016, 08:50
Respuesta: Re: Command Processor [Faster Than I-ZCMD!] - by Swedky - 23.10.2016, 09:07
Re: Command Processor [Faster Than I-ZCMD!] - by Mister0 - 23.10.2016, 11:01
Re: Command Processor [Faster Than I-ZCMD!] - by Yashas - 23.10.2016, 11:13
Re: Command Processor [Faster Than I-ZCMD!] - by Mister0 - 25.10.2016, 14:48
Re: Command Processor [Faster Than I-ZCMD!] - by Yashas - 25.10.2016, 16:57
Re: Command Processor [Faster Than I-ZCMD!] - by JJohnson1 - 01.11.2016, 08:20
Re: Command Processor [Faster Than I-ZCMD!] - by BrianFaria - 23.11.2016, 11:34
Re: Command Processor [Faster Than I-ZCMD!] - by BigETI - 10.01.2019, 23:32
Re: Command Processor [Faster Than I-ZCMD!] - by J0sh... - 11.01.2019, 00:10

Forum Jump:


Users browsing this thread: 1 Guest(s)