06.08.2013, 20:58
Quote:
Can someone make jail and unjail filterscript only for ADMINS
please can someone make totally new filterscript for it.. |
Код:
CMD:jail(playerid, params[]) { new string[128], giveplayerid, minutes, reason[64]; if(sscanf(params, "uds[64]", giveplayerid, minutes, reason)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /jail [playerid] [minutes] [reason]"); if(minutes < 0 || minutes > 30) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't jail for more than 30 minutes."); if (PlayerInfo[playerid][pAdmin] >= 2) { if(IsPlayerConnected(giveplayerid)) { if(PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin]) { SendClientMessageEx(playerid, COLOR_WHITE, "You can't perform this action on an equal or higher level administrator."); return 1; } if(GetPVarInt(giveplayerid, "IsInArena") >= 0) { LeavePaintballArena(giveplayerid, GetPVarInt(giveplayerid, "IsInArena")); } ResetPlayerWeaponsEx(giveplayerid); new year, month,day; getdate(year, month, day); format(string, sizeof(string), "AdmCmd: %s has been jailed by %s, reason: %s(%d-%d-%d)", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason, month, day, year); Log("logs/admin.log", string); format(string, sizeof(string), "AdmCmd: %s has been jailed by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason); SendClientMessageToAllEx(COLOR_LIGHTRED, string); ResetPlayerWeaponsEx(giveplayerid); WantedPoints[giveplayerid] = 0; PlayerInfo[giveplayerid][pJailed] = 1000; PhoneOnline[giveplayerid] = 1; PlayerInfo[giveplayerid][pJailTime] = minutes*60; SetPlayerInterior(giveplayerid, 10); new rand = random(sizeof(LSPDJail)); SetPlayerFacingAngle(giveplayerid, 0); TogglePlayerControllable(giveplayerid, 1); SetPlayerPos(giveplayerid, LSPDJail[rand][0], LSPDJail[rand][1], LSPDJail[rand][2]); PlayerInfo[giveplayerid][pVW] = 133337; SetPlayerVirtualWorld(giveplayerid, 133337); format(string, sizeof(string), "You are jailed for %d minutes. Bail: Unable", minutes); SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string); format(PlayerInfo[giveplayerid][pPrisonedBy], 24, "%s", GetPlayerNameEx(playerid)); format(PlayerInfo[giveplayerid][pPrisonReason], 128, "[OOC][JAIL] %s", reason); } } else { SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!"); } return 1; }
Код:
CMD:release(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 3) { new string[128], giveplayerid, reason[64]; if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /release [playerid] [reason]"); if(IsPlayerConnected(giveplayerid)) { new year, month,day; getdate(year, month, day); format(string, sizeof(string), "AdmCmd: %s has been released from prison by %s, reason: %s(%d-%d-%d)", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason, month, day, year); Log("logs/admin.log", string); format(string, sizeof(string), "AdmCmd: %s has been released from prison by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason); SendClientMessageToAllEx(COLOR_LIGHTRED, string); WantedPoints[giveplayerid] = 0; PlayerInfo[giveplayerid][pJailed] = 0; PlayerInfo[giveplayerid][pWantedLevel] = 0; PlayerInfo[giveplayerid][pBeingSentenced] = 0; SetPlayerToTeamColor(giveplayerid); SetPlayerWantedLevel(giveplayerid, 0); PlayerInfo[giveplayerid][pJailTime] = 0; SetPlayerPos(giveplayerid, 1529.6,-1691.2,13.3); SetPlayerInterior(giveplayerid,0); PlayerInfo[giveplayerid][pInt] = 0; SetPlayerVirtualWorld(giveplayerid, 0); PlayerInfo[giveplayerid][pVW] = 0; PlayerInfo[giveplayerid][pLocal] = 255; } } else { SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!"); } return 1; }