Stop commands
#1

How to stop commands for every player who is in the jail?
Reply
#2

OnPlayerCommandReceived()
if( is in jail)
return 0;
Reply
#3

Where to add this?
Reply
#4

Please help me..
Reply
#5

Use what he said.

Quote:
Originally Posted by Mellnik
Посмотреть сообщение
OnPlayerCommandReceived()
if( is in jail)
return 0;
Put "if(YourCheckIfPlayerIsInJailHere) return 0;" under "public OnPlayerCommandReceived()".
Reply
#6

Quote:
Originally Posted by Mellnik
Посмотреть сообщение
OnPlayerCommandReceived()
if( is in jail)
return 0;
Quote:
Originally Posted by OsteeN
Посмотреть сообщение
Use what he said.



Put "if(YourCheckIfPlayerIsInJailHere) return 0;" under "public OnPlayerCommandReceived()".
Do as they both said, but the callback is "OnPlayerCommandText".
So it would be:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
        if(/*Put your jail variable here*/)
        {
             return 0;
        }
        return 0;
}
Reply
#7

Quote:
Originally Posted by AdHaM612
Посмотреть сообщение
Do as they both said, but the callback is "OnPlayerCommandText".
So it would be:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
        if(/*Put your jail variable here*/)
        {
             return 0;
        }
        return 0;
}
Yeah, I just copied the other guys callback, lol.
Reply
#8

Can you give me some other way? I really dont understand this way..
Reply
#9

EDIT: Nevermind, did it wrong, sorry
Reply
#10

Quote:
Originally Posted by AdHaM612
Посмотреть сообщение
Do as they both said, but the callback is "OnPlayerCommandText".
So it would be:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
        if(/*Put your jail variable here*/)
        {
             return 0;
        }
        if(strcmp, blah blah.....//strcmp command
        {
             return 1;
        }
        return 0;
}
shouldn't have to change command processors to do this. it's already been posted multiple times.
You don't need the zcmd callback OnPlayerRecievedCommand or whatever it is, you can put it in onPlayercommandText, just make sure its the first thing in the callback, all your strcmp commands must be below it see the example i edited.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)