[ Pawn.CMD ] Blocking Commands
#1

I wanted to block all commands expect only one, I wanted to do it on the callback "OnPlayerCommandReceived" but can't get it to work, do I need to add code to every command that I want to block like "if(blabla) return blabla" or is there a way, Pawn.CMD even tho its in the title
Reply
#2

Try to use if condition, pass the command for selected only and for else return 0
Reply
#3

Quote:
Originally Posted by iorp
Посмотреть сообщение
Try to use if condition, pass the command for selected only and for else return 0
I tried it like this but it gives an error

PHP код:
    if((my code) && cmd != ban)
    {
        
SendClientMessage(playerid, -1"Error !");
        return 
0;
    }
// error 017: undefined symbol "ban" // 
Reply
#4

Quote:
Originally Posted by IdonTmiss
Посмотреть сообщение
I tried it like this but it gives an error

PHP код:
    if((my code) && cmd != ban)
    {
        
SendClientMessage(playerid, -1"Error !");
        return 
0;
    }
// error 017: undefined symbol "ban" // 
that is not a integer to compare, use
Код:
if(!strcmp("ban", cmdtext))
Reply
#5

Quote:
Originally Posted by iorp
Посмотреть сообщение
that is not a integer to compare, use
Код:
if(!strcmp("ban", cmdtext))
Hmm thanks for the advice but I figured it out, not using the strcmp or anything, but thanks anyway
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)