SA-MP Forums Archive
How to disable commands in jail? - 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)
+--- Thread: How to disable commands in jail? (/showthread.php?tid=488917)



How to disable commands in jail? - Audi_Quattrix - 19.01.2014

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

I am using ZCMD!


Re: How to disable commands in jail? - AchievementMaster360 - 19.01.2014

What commands do they use to teleport away?


Re: How to disable commands in jail? - Audi_Quattrix - 19.01.2014

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?


Re: How to disable commands in jail? - Audi_Quattrix - 19.01.2014

Fixed it myself.

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



Re: How to disable commands in jail? - [..MonTaNa..] - 19.01.2014

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.");



Re: How to disable commands in jail? - RedWingz - 19.01.2014

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.


Re: How to disable commands in jail? - [TMS]Legena - 19.01.2014

Код:
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....
}