Block ZCMD avaiable commands
#1

On strcmp / strtok and dcmd, I used to block commands with a array:
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new logged[MAX_PLAYERS];
    if(logged[playerid] == 0) return ... ; // That would block all dcmd/strcmp
    if(!strcmp(cmdtext,"/test",true))
    {
           return 1;
    }
    dcmd(purple,6,cmdtext);
    return 0;
}
But, does anyone knows how to block all zcmd? I'm asking because it's not on a callback for be put through of. It's like each callback per command. Thanks,
Reply
#2

pawn Code:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if(logged[playerid] == 0)
    {
        //If Not Logged...
        return 0; // That would block all zcmd
    }
    return 1;
}
That should work as long as you return 0.
Reply
#3

In my opinion, you have to add the return function inside the 'zcmd.inc file' because there is an OnPlayerCommandText callback in this place, so, probably it is what make the zcmd commands working

It makes sense, because we have to delete OnPlayerCommandText before use zcmd


I hope that i have helped
Reply
#4

i think you added
pawn Code:
#include zcmd
remove that then it will work
Reply
#5

Why are people still responding, IronBoy what are you even saying? Are you just trying to be a smart ass or actually trying to answer a question?
Reply
#6

I have the same problem which blackwave said.Before i added
pawn Code:
#include zcmd
on the top of my script and i cant use any other commands.Finally i deleated
#incluse zcmd from the script and it works, that only i told him! -.-
Reply
#7

He didn't have a problem, He had a question, The question was "How do i block ZCMD commands from people that are not logged in".
Reply
#8

@Ironboy: It's due you can't use zcmd/strcmp at same time

@topic: Thanks 4all. Resolved.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)