18.02.2014, 17:20
(
Последний раз редактировалось DaniceMcHarley; 01.06.2017 в 02:51.
)
------
new IsInJail[MAX_PLYAERS];//you can use it to check if the player is in the jail and stop functions/stuff from happening.
//CMD
{
ResetPlayerWeapons(playerid);//no need, add what ever functions you want.
SetPlayerPos(playerid,0,0,0);
IsInJail[playerid]=1;
SetTimerEx("EndPlayerJail", 30000, false, "i", playerid);//change the timer(currently is 30sec)
}
forward EndPlayerJail(playerid);
public EndPlayerJail(playerid)
{
IsInJail[playerid]=0;
SetPlayerPos(playerid,0,0,0);
return 1;
}
CMD:prison(playerid, params[]) {
if(PlayerInfo[playerid][pAdmin] >= 3) {
if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
return SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");
new string[128], giveplayerid, minutes, reason[64];
if(sscanf(params, "uds[64]", giveplayerid, minutes, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /prison [playerid/partofname] [minutes] [reason]");
if(IsPlayerConnected(giveplayerid))
{
if(PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin] && AdminDuty[giveplayerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "You can't perform this action on an equal or higher level admin that is on-duty.");
return 1;
}
SetPlayerArmedWeapon(giveplayerid, 0);
/*if(GetPVarInt(giveplayerid, "PBM") > 0)
{
LeavePaintballArena(giveplayerid, GetPVarInt(giveplayerid, "IsInArena"));
}*/
GameTextForPlayer(giveplayerid, "~w~Welcome to ~n~~r~Admin Prison", 5000, 3);
ResetPlayerWeaponsEx(giveplayerid);
format(string, sizeof(string), "AdmCmd: %s has been prisoned by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
Log("logs/admin.log", string);
format(string, sizeof(string), "AdmCmd: %s has been prisoned by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
SendClientMessageToAllEx(COLOR_LIGHTRED, string);
if(PlayerDraggedBy[giveplayerid] != INVALID_PLAYER_ID) {
IsCopDragging[PlayerDraggedBy[giveplayerid]] = INVALID_PLAYER_ID;
PlayerDragged[giveplayerid] = 0;
PlayerDraggedBy[giveplayerid] = INVALID_PLAYER_ID;
}
PlayerInfo[giveplayerid][pWantedLevel] = 0;
SetPlayerWantedLevel(giveplayerid, 0);
PlayerInfo[giveplayerid][pJailed] = 3;
PlayerInfo[giveplayerid][pJailTime] = minutes*60;
if(IsPlayerAttachedObjectSlotUsed(giveplayerid, 0))
RemovePlayerAttachedObject(giveplayerid, 0);
format(PlayerInfo[giveplayerid][pPrisonReason], 128, "%s", reason);
format(PlayerInfo[giveplayerid][pPrisonedBy], MAX_PLAYER_NAME, "%s", GetPlayerNameEx(playerid));
PhoneOnline[giveplayerid] = 1;
TogglePlayerControllable(giveplayerid, 0);
for(new o = 0; o < 6; o++)
{
TextDrawShowForPlayer(giveplayerid, ObjectsLoadingTD[o]);
}
SetPVarInt(giveplayerid, "LoadingObjects", 1);
SetTimerEx("SafeLoadObjects", 3000, 0, "d", giveplayerid);
SetPlayerInterior(giveplayerid, 69);
PlayerInfo[giveplayerid][pVW] = 696969;
PlayerInfo[giveplayerid][pInt] = 69;
SetPlayerVirtualWorld(giveplayerid, 696969);
new rand = random(sizeof(AdminPrisonFloat));
SetPlayerPos(giveplayerid, AdminPrisonFloat[rand][0], AdminPrisonFloat[rand][1], AdminPrisonFloat[rand][2]);
SetPlayerSkin(giveplayerid, 50);
SetPlayerColor(giveplayerid, TEAM_APRISON_COLOR);
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");
}
return 1;
}