SA-MP Forums Archive
Block ZCMD avaiable commands - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Block ZCMD avaiable commands (/showthread.php?tid=236689)



Block ZCMD avaiable commands - blackwave - 08.03.2011

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,


Re: Block ZCMD avaiable commands - [WF]Demon - 08.03.2011

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.


Re: Block ZCMD avaiable commands - rjjj - 08.03.2011

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


Re: Block ZCMD avaiable commands - Ironboy - 08.03.2011

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


Re: Block ZCMD avaiable commands - [WF]Demon - 08.03.2011

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?


Re: Block ZCMD avaiable commands - Ironboy - 08.03.2011

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! -.-


Re: Block ZCMD avaiable commands - [WF]Demon - 08.03.2011

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".


Re: Block ZCMD avaiable commands - blackwave - 08.03.2011

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

@topic: Thanks 4all. Resolved.