Commands not allowed!
#1

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)
Reply
#2

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");
Reply
#3

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?
Reply
#4

Yes indeed.
Reply
#5

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?
Reply
#6

What do you use for commands? zcmd, dcmd, OnPlayerCommandText with strcmp/strtok?
Reply
#7

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.
Reply
#8

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
Reply
#9

You need to return 0.

pawn Код:
if(PlayerInfo[playerid][Jailed] == 1) {
   SendClientMessage(playerid, 0, "You can't use this command inside prison.");
   return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)