How to disable commands in jail?
#1

I made jail system but players can teleport out easily.
How to disable commands but not chat in jail?

I am using ZCMD!
Reply
#2

What commands do they use to teleport away?
Reply
#3

There is alot.
Like /aa /sf /lv /ls /lvair /sfair /lsair /nrg /place1 /place2 /place3 and so on.
So is there a way to stop all commands instead of disabling 1 by 1?
Reply
#4

Fixed it myself.

For others who have same problem
pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])  //return 0 to disable commands
Reply
#5

pawn Код:
// Put this somewhere in your jail CMD.
SetPVarInt(playerid, "Caged", = 1);
pawn Код:
// Put this in each teleport CMD.
if(GetPVarInt(playerid, "Caged") == 1) return SendClientMessage(playerid, -1, "You cannot use this command when you're jailed.");
Reply
#6

Quote:
Originally Posted by [..MonTaNa..]
Посмотреть сообщение
pawn Код:
// Put this somewhere in your jail CMD.
SetPVarInt(playerid, "Caged", = 1);
pawn Код:
// Put this in each teleport CMD.
if(GetPVarInt(playerid, "Caged") == 1) return SendClientMessage(playerid, -1, "You cannot use this command when you're jailed.");
I was just going to post that since it's in my script.
But yea, put that in your script and it'll work since I use the same code.
Reply
#7

Код:
new playerinjail[MAX_PLAYERS];
Put this on top of script

In teleport commands put this
Код:
if(playerinjail[playerid] == 1)
{
SendClientMessage(0xFFFFFF,"You can't use this command in jail!"
}
else
{
SetPlayerPos....
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)