Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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);
- SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_NONE);
- RemovePlayerAttachedObject(giveplayerid,0);
- 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;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement