13.12.2011, 18:01
Like when someone uses some command for example /kill, it allows them, even if they are jailed.
I'm jailed and I use /kill, it says "You have suicided" but after that, it sends "Server:Unknown command", but I just want to prevent him from using /kill while jailed.
I'm jailed and I use /kill, it says "You have suicided" but after that, it sends "Server:Unknown command", but I just want to prevent him from using /kill while jailed.
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
for(new i, f = Robplaces; i < f; i++)
{
if(strcmp(cmdtext,RobCMDS[i]) == 0 && IsPlayerInRangeOfPoint(playerid, 5,RobPos[i][0],RobPos[i][1],RobPos[i][2]))
{
if(PInfo[playerid][RobbedStore] == 1) return SendClientMessage(playerid, Red, "« Error » "lyellow"You have recently robbed a store, please wait");
GameTextForPlayer(playerid,"~r~~h~Time left: 10",4000,3);
SendClientMessage(playerid, Red,"» "lorange"You have started a robbery... Please stay in the radius of this place");
RobbingTimer[playerid] = SetTimerEx("Robbing",1000,true,"i",playerid);
RobbingID[playerid] = i;
RobbingTimeLeft[playerid] = 10;
return 1;
}
}
if(PInfo[playerid][Jailed] == 1 && strcmp(cmdtext,"/escape") != 0)
{
SendClientMessage(playerid,Red,"You can't use commands in jail.");
return 0;
}
else if(success)
{
return 1;
}
return -1;
}