CMD:jail(playerid, params[]){new giveplayerid, time,reason[128];new name[MAX_PLAYER_NAME], giveplayername[MAX_PLAYER_NAME];if(!sscanf(params,\"dds\",giveplayerid,time,reason)){ if(AccInfo[playerid][Admin] >= 2) { if(IsPlayerConnected(giveplayerid)) { if(AccInfo[giveplayerid][Jailed] == 0) { SetPlayerInterior(giveplayerid, 0); AccInfo[giveplayerid][JailTime] = time*1000*60; JailTimer[giveplayerid] = SetTimerEx(\"UnJail\",AccInfo[giveplayerid][JailTime],0,\"d\",giveplayerid); SetPlayerPos(giveplayerid,1690.80004883,-1950.59997559,9.80000019); AccInfo[giveplayerid][Jailed] = 1; GetPlayerName(playerid,name,sizeof(name)); GetPlayerName(giveplayerid,giveplayername,sizeof(giveplayername)); format(reason,sizeof(reason),\"%s börtönbe zárta %s -t, %d percre. Indok: %s\",name,giveplayername,time,reason); SendClientMessageToAll(COLOR_PURPLE, reason); } else { SendClientMessage(playerid, COLOR_RED,\"Ez a játékos már börtönben van!\"); } } else { SendClientMessage(playerid, COLOR_RED,\"Hiba: Rossz ID\"); }}else{ SendClientMessage(playerid, COLOR_RED,\"Nem vagy elég magas szintû adminsztrátor!\");}}else{ SendClientMessage(playerid, COLOR_RED,\"Használat: /jail [Playerid] [Perc] [indok]\");}return 1;}
CMD:unjail(playerid, params[]){new giveplayerid, giveplayername[MAX_PLAYER_NAME];new name[MAX_PLAYER_NAME];if(!sscanf(params,\"i\",giveplayerid)){ if(AccInfo[playerid][Admin] >= 2) { if(IsPlayerConnected(giveplayerid)) { if(AccInfo[giveplayerid][Jailed] == 1) { new string[128]; UnJail(giveplayerid); GetPlayerName(giveplayerid,giveplayername,sizeof(giveplayername)); GetPlayerName(playerid,name,sizeof(name)); format(string,sizeof(string),\"%s Kiengedte a Börtönbõl %s-t\",name,giveplayername); SendClientMessageToAll(COLOR_PURPLE, string); } else { SendClientMessage(playerid, COLOR_RED,\"Hiba: A játékos nincs börtönben.\"); } } else { SendClientMessage(playerid, COLOR_RED,\"Hiba: Rossz ID\"); }}else{ SendClientMessage(playerid, COLOR_RED,\"Nem vagy elég magas szintû adminisztrátor!\");}}else{ SendClientMessage(playerid, COLOR_RED,\"Használat: /unjail [Playerid]\");}return 1;}
public UnJail(giveplayerid){AccInfo[giveplayerid][Jailed] = 0;KillTimer(JailTimer[giveplayerid]);SpawnPlayer(giveplayerid);SendClientMessage(giveplayerid, COLOR_RED,\"Kiengedtek!\");return 1;}
if(IsPlayerAdmin(playerid))
if(/* Változó */ >= /* Ahányas adminszinttõl */
if(valtozo == 1){ print(\"Jailban vagy, nem tudsz parancsokat használni!\");}else{ // Ide azt, amit csináljon a parancs.}
valtozo = 1;
valtozo = 0;
public OnPlayerCommandReceived(playerid, cmdtext[]){ if(Börtön[playerid][Jailed] == 1){ SendClientMessage(playerid, 0xFF0000AA, \"Börtönbe nincs parancs használat!\");return 0;}return 1;}