Commands not allowed! - 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: Commands not allowed! (
/showthread.php?tid=264641)
Commands not allowed! -
Postalityjr - 27.06.2011
Okay so I can jail people properly. But I want to make it so they can't use commands while in jail. This is code that is saying that you're in jail;
if(PlayerInfo[playerid][Jailed] == 1)
Re: Commands not allowed! -
=WoR=Varth - 27.06.2011
You can put that in your command.
Example:
pawn Код:
if(PlayerInfo[playerid][Jailed] == 1) return SendClientMessage(playerid,Red,"You can't use this command inside prison");
Re: Commands not allowed! -
Postalityjr - 27.06.2011
Quote:
Originally Posted by varthshenon
You can put that in your command.
Example:
pawn Код:
if(PlayerInfo[playerid][Jailed] == 1) return SendClientMessage(playerid,Red,"You can't use this command inside prison");
|
So your saying I have to put that in every command I have?
Re: Commands not allowed! -
=WoR=Varth - 27.06.2011
Yes indeed.
Re: Commands not allowed! -
Postalityjr - 27.06.2011
Quote:
Originally Posted by varthshenon
Yes indeed.
|
There's no other way to make it so all the commands aren't able to be used?
Re: Commands not allowed! -
Calgon - 27.06.2011
What do you use for commands? zcmd, dcmd, OnPlayerCommandText with strcmp/strtok?
Re: Commands not allowed! -
Donya - 27.06.2011
if zcmd, put it on the start of "OnPlayerCommandRecieved".
if dcmd/onplayercommandtext(strcmp), put it at the start of "OnPlayerCommandText"
if ycmd, do the same as zcmd.
Re: Commands not allowed! -
Postalityjr - 27.06.2011
Quote:
Originally Posted by Calg00ne
What do you use for commands? zcmd, dcmd, OnPlayerCommandText with strcmp/strtok?
|
I use zcmd.
EDIT:: I put it OnPlayerCommandReceived and for zcmd and now it doesn't let me use any commands
Re: Commands not allowed! -
Calgon - 27.06.2011
You need to return 0.
pawn Код:
if(PlayerInfo[playerid][Jailed] == 1) {
SendClientMessage(playerid, 0, "You can't use this command inside prison.");
return 0;
}