12.06.2017, 18:17
Hey there,
I have tried a lot of options to fix this problem but I couldn't find a valid solution. I use zcmd in a gamemode and I scripted an anti spam recently, it works fine but the thing is I'd like to skip a few commands, keep them out of the anti spam script.
I can skip them like that;
With this code, we prevent the anti spam system to keep "/xx" command out of spam but the thing is, my /xx command has a value, it works like '/xx [texthere]'
So the output at the end is something like that "/xx hello" so, how can I block this ? Using a similar code as above?
EDIT: If you wonder the command;
Basically something like that, I get params from the cmd and use it somewhere else.
I have tried a lot of options to fix this problem but I couldn't find a valid solution. I use zcmd in a gamemode and I scripted an anti spam recently, it works fine but the thing is I'd like to skip a few commands, keep them out of the anti spam script.
I can skip them like that;
Код:
new lastcmd[MAX_PLAYERS]; public OnPlayerCommandPerformed(playerid,cmdtext[],success) { if(!success) return 1; if(success) { lastcmd[playerid]=gettime(); } return 1; } public OnPlayerCommandReceived(playerid, cmdtext[]) { if(strcmp(cmdtext, "/xx", false)) { if(lastcmd[playerid]!=0 && gettime()-lastcmd[playerid] <= 3) { SendClientMessage(playerid,-1,"stop spamming"); return 0; } } return 1; }
So the output at the end is something like that "/xx hello" so, how can I block this ? Using a similar code as above?
EDIT: If you wonder the command;
Код:
CMD:xx(playerid, params[]) { if(isnull(params)) return SendClientMessage(playerid,-1,"/xx [text]"); return 1; }