PHP код:
CMD:jail(playerid, params[])
{
if(pInfo[playerid][AdminLevel] < 1) return SendClientMessage(playerid, -1, "{FF0000}[SYSTEM ERROR]: You don't have the privilege to use that command.");
{
new id, string[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]",id, reason)) 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(id, 7);
SetPlayerPos(id, 288.74350, -134.53122, 1003.05688);
SetPlayerVirtualWorld(id, 10);
SetPlayerHealth(id, 9999999);
ResetPlayerWeapons(id);
GetPlayerName(playerid, admin,sizeof(admin));
GetPlayerName(id, name, sizeof(name) ) ;
format(string, sizeof string, "{FF0000}[SYSTEM]: %s has been jailed by %s | Reason: {FFFF00}%s", name, admin, reason);
SendClientMessageToAll(-1, string);
Jailed[id] = 1;
}
return 1;
}
///////////
CMD:unjail(playerid, params[])
{
if(pInfo[playerid][AdminLevel] < 1) return SendClientMessage(playerid, -1,"{FF0000}[SYSTEM ERROR]: You don't have the privilege to use that command.");
{
new id, string[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(id, 0);
SetPlayerInterior(id, 0);
SetPlayerHealth(id, 100);
GivePlayerMoney(id, -800);
GivePlayerWeapon(id, 24,60);
SpawnPlayer(id);
GetPlayerName(playerid, admin,sizeof(admin));
GetPlayerName(id, name, sizeof(name) ) ;
format(string, sizeof string, "{FF0000}[SYSTEM]: {FFFFFF}%s has been released from jail by %s",name, admin);
SendClientMessageToAll(-1, string);
Jailed[id] = 0;
}
return 1;
}