Command Disabling
#4

Quote:
Originally Posted by ALiScripter
Посмотреть сообщение
PHP код:
public OnPlayerCommandPerformed(playeridcmdtext[], success
this should be used, if you are using ZCMD.
This callback is called when command is executed, so won't prevent from executing commands

First you have to declare a global variable, ex:
PHP код:
new bool:AllowCmds
and make true by default OnGameModeInit
And make your command to toggle it

And to prevent executing the commands, If you are uzing zcmd:
PHP код:
public OnPlayerCommandReceived(playeridcmdtext[])
{
    if(
AllowCmds == false)
    {
        
SendClientMessage(playerid,-1,"Commands are disabled by an admin!");
        return 
0;
    }
    return 
1;

Reply


Messages In This Thread
Command Disabling - by BurnZ - 13.08.2016, 08:52
Re: Command Disabling - by WildWave - 13.08.2016, 08:59
Re: Command Disabling - by Logic_ - 13.08.2016, 09:22
Re: Command Disabling - by Shinja - 13.08.2016, 12:14
Re: Command Disabling - by BurnZ - 13.08.2016, 12:17
Re: Command Disabling - by justice96 - 13.08.2016, 12:20
Re: Command Disabling - by Shinja - 13.08.2016, 12:21
Re: Command Disabling - by SickAttack - 13.08.2016, 16:33
Re: Command Disabling - by BurnZ - 14.08.2016, 00:41

Forum Jump:


Users browsing this thread: 2 Guest(s)