jail bug
#3

Quote:
Originally Posted by Mencent
Посмотреть сообщение
Hello!

You have the false order of the if-clause.

PHP код:
CMD:jail(playeridparams[])
{
      if(
pInfo[playerid][AdminLevel] < 1) return SendClientMessage(playerid, -1"{FF0000}[SYSTEM ERROR]: You don't have the privilege to use that command.");
      {
           new 
idstring[128],reason[100], admin[24], name[24];
           if(
pInfo[playerid][Logged] == 0) return SendClientMessage(playerid, -1"{FF0000}[SYSTEM[: {FFFFFF}You have to login before you can use commands !");
           if(
sscanf(params"ds[64]",idreason)) return SendClientMessage(playerid, -1"{FF0000}[SYSTEM ERROR]: {FFFFFF}USAGE: /jail [id] [reason]");
           if(!
IsPlayerConnected(id)) return SendClientMessage(playerid, -1"{FF0000}[SYSTEM ERROR]: The ID you have inputted is incorrect");
           if(
Jailed[id] == 1) return SendClientMessage(playerid, -1"{FF0000}[SYSTEM]: The player is already jailed");
           
SetPlayerInterior(id7);
           
SetPlayerPos(id288.74350, -134.531221003.05688);
           
SetPlayerVirtualWorld(id10);
           
SetPlayerHealth(id9999999);
           
ResetPlayerWeapons(id);
           
GetPlayerName(playeridadmin,sizeof(admin));
           
GetPlayerName(idnamesizeof(name) ) ;
           
format(stringsizeof string"{FF0000}[SYSTEM]: %s has been jailed by %s | Reason: {FFFF00}%s"nameadminreason);
           
SendClientMessageToAll(-1string);
           
Jailed[id] = 1;
     }
     return 
1;
}
///////////
CMD:unjail(playeridparams[])
{
    if(
pInfo[playerid][AdminLevel] < 1) return SendClientMessage(playerid, -1,"{FF0000}[SYSTEM ERROR]: You don't have the privilege to use that command.");
    {
           new 
idstring[128],admin[24], name[24];
           if(
pInfo[playerid][Logged] == 0) return SendClientMessage(playerid, -1"{FF0000}[SYSTEM[: {FFFFFF}You have to login before you can use commands !");
           if(
pInfo[playerid][AdminLevel] >= 1) return SendClientMessage(playerid, -1,"{FF0000}[SYSTEM ERROR]: You don't have the privilege to use that command.");
           if(
sscanf(params"d",id)) return SendClientMessage(playerid, -1"{FF0000}[SYSTEM ERROR]: {FFFFFF}USAGE: /unjail [id]");
           if(!
IsPlayerConnected(id)) return SendClientMessage(playerid, -1"{FF0000}[SYSTEM ERROR]: The ID you have inputted is incorrect");
           if(
Jailed[id] != 0) return SendClientMessage(playerid, -1"{FF0000}[SYSTEM]: The player is not jailed");
           
SetPlayerVirtualWorld(id0);
           
SetPlayerInterior(id0);
           
SetPlayerHealth(id100);
           
GivePlayerMoney(id, -800);
           
GivePlayerWeapon(id24,60);
           
SpawnPlayer(id);
           
GetPlayerName(playeridadmin,sizeof(admin));
           
GetPlayerName(idnamesizeof(name) ) ;
           
format(stringsizeof string"{FF0000}[SYSTEM]: {FFFFFF}%s has been released from jail by %s",nameadmin);
           
SendClientMessageToAll(-1string);
           
Jailed[id] = 0;
    }
    return 
1;

Try this.


- Mencent
I still don't have the privilege to use unjail command, by the way what did u changed?
Reply


Messages In This Thread
jail bug - by Glossy42O - 24.07.2015, 19:59
AW: jail bug - by Mencent - 24.07.2015, 20:02
Re: AW: jail bug - by Glossy42O - 24.07.2015, 20:05
Re: jail bug - by XVlaDX - 24.07.2015, 20:06
AW: jail bug - by Mencent - 24.07.2015, 20:07
Re: jail bug - by xVIP3Rx - 24.07.2015, 20:07
Re: jail bug - by MBilal - 24.07.2015, 20:07
Re: AW: jail bug - by Glossy42O - 24.07.2015, 20:10
AW: jail bug - by Mencent - 24.07.2015, 20:11
Re: jail bug - by Glossy42O - 24.07.2015, 20:18

Forum Jump:


Users browsing this thread: 3 Guest(s)