Cancel CMD in a Situation
#1

Hi Guyz

Here's my doubt.

When a specific player type /jail ID, a player will be arrested (this command is already done).
What I want, it's when this player is in Jail, he can't use cmd's, like /kill or /home, because is make the Jail no sense, know what I mean?

How do can I do this?

Thanks!
Reply
#2

Use a variable to check if the player is jailed.

Can you post your /jail command please?
Reply
#3

Yes, but it will check and then what?
I need some functions to cancel the player commands.
Reply
#4

Quote:
Originally Posted by shark
Yes, but it will check and then what?
I need some functions to cancel the player commands.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/kill", cmdtext, true, 10) == 0)
    {
        if(IsPlayerInJail(playerid)) { // or whatever your jail check function is
            SendClientMessage(playerid, colour, "You are in jail, no commands for you");
          } else {
            SetPlayerHealth(playerid, 0);
          }
        return 1;
    }
    return 0;
}
You get the idea anyway.
Reply
#5

Thanks SnowFlake!
I think it's exactly what I meant.

Cya!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)