SA-MP Forums Archive
Cancel CMD in a Situation - 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: Cancel CMD in a Situation (/showthread.php?tid=65072)



Cancel CMD in a Situation - shark - 09.02.2009

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!


Re: Cancel CMD in a Situation - Lewwy - 09.02.2009

Use a variable to check if the player is jailed.

Can you post your /jail command please?


Re: Cancel CMD in a Situation - shark - 09.02.2009

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


Re: Cancel CMD in a Situation - SilentMouse - 09.02.2009

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.


Re: Cancel CMD in a Situation - shark - 09.02.2009

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

Cya!