How to disable commands in jail?
#1

Hello!
IM using LuxAdmin and im making a stunt server. But players keep teleporting out of jail when they are jailed. Any way i can disable commands in jail?
Reply
#2

Just make a variable.
//top of script
new CommandUse=0;

command /kill
{
if(CommandUse==1) so you can use the command
{
function of the command
}
if(CommandUse==0)You cant use the command
{
SendClientMessage(playerid,COLOR_RED,"You cannot use this command in jail!");
}
}
Reply
#3

Umm, explain please? I do not understand.
Reply
#4

Quote:
Originally Posted by Sensitive
Посмотреть сообщение
Umm, explain please? I do not understand.
Admigo means that you need to make variables so you can check at commands if the player is in the jail. Example:

pawn Код:
if(Player[playerid][Jail] == 1) return SendClientMessage(playerid, 0xFF6347AA ,"You can't do this. You are jailed!");
You know how to create that?
Reply
#5

Its easy to use the variables and usefull
Reply
#6

Lol, should i add it under my teleports and other cmds or under what? I am noob i know I just haven't tried to do things like this before.
Reply
#7

Add under OnPlayerSpawn
pawn Код:
if(Player[playerid][Jailed] == 1)
    {
    //Action whatever you want
    }
Then if you jail someone, set the player to Jailed == 1.
Then add under every minigame/dm command that check what I've writed above.
Don't forget to set Jailed to 0 when the person is unjailed.
Reply
#8

I tried but still omg. I did this...

Quote:

public OnPlayerSpawn(playerid)
if(Player[playerid][Jailed] == 1)
{
SendClientMessage(playerid, 0xFF6347AA ,"You can't do this. You are jailed!");
}

But i do not know how should it help lol?
Reply
#9

Quote:
Originally Posted by Sensitive
Посмотреть сообщение
I tried but still omg. I did this...



But i do not know how should it help lol?
It helps in a way, that the player can't do anything, while he's in jail, he won't be able to use any cmd
Reply
#10

Here look:
Код:
if (strcmp("/kill", cmdtext, true, 10) == 0)
{
     if(CommandUse==1)//can use
     {
	   SetPlayerHealth(playerid,0);
	   return 1;
     }
     if(CommandUse==0)//cant use
     {
           SendClientMessage(playerid,COLOR_RED,"You cannot use this command in jail!");
           return 1;
     }
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)