how to disable all commands
#8

Quote:
Originally Posted by BenzoAMG
View Post
Yes, the second poster's code would work in the case of ZCMD. However, this will block pretty much ALL commands. However, let's say for example that you want players to be able to use /admins even if they aren't logged in.

ZCMD:
pawn Code:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if(strcmp(cmdtext,"/admins",true) != 0)
    {
        if(Spawned[playerid] == false) return SendClientMessage(playerid, 0xFF0000FF, "You must be spawned to use this command");
    }
    return 1;
}
STRCMP:
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext,"/admins",true) != 0)
    {
        if(Spawned[playerid] == false) return SendClientMessage(playerid, 0xFF0000FF, "You must be spawned to use this command");
    }
    return 1;
}
Wow nice! Anyway as you said it will block all commands. But do you think is there any other way to exempt this /admins command somewhere here?

Code:
if(pInfo[playerid][Spawned] == 0)
{
        SendClientMessage(playerid, -1, "You have to be logged in.");
        return 0;
}
Reply


Messages In This Thread
how to disable all commands - by kbalor - 22.10.2013, 14:55
Re: how to disable all commands - by Threshold - 22.10.2013, 15:03
Re: how to disable all commands - by ]Rafaellos[ - 22.10.2013, 15:05
Re: how to disable all commands - by Wizzy951 - 22.10.2013, 15:06
Re: how to disable all commands - by kbalor - 22.10.2013, 15:12
Re: how to disable all commands - by Threshold - 22.10.2013, 15:19
Re: how to disable all commands - by kbalor - 22.10.2013, 15:21
Re: how to disable all commands - by kbalor - 22.10.2013, 15:27
Re: how to disable all commands - by Threshold - 22.10.2013, 15:33
Re: how to disable all commands - by gotwarzone - 22.10.2013, 15:42

Forum Jump:


Users browsing this thread: 1 Guest(s)