CMD:ajail(playerid, params[])
{
if(pInfo[playerid][pAdminLevel] > 0)
{
new targetid, minutes, reason[205], str[205];
if(sscanf(params, "ris[205]", targetid, minutes, reason)) return SendClientMessage(playerid, COLOR_ADMIN, "USAGE: /ajail [id] [minutes] [reason]");
if(minutes <= 0 || minutes > 180) return SendClientMessage(playerid, COLOR_ADMIN, "ERROR: Minutes can't be less than 0 or more than 180!");
if(inJail[targetid]) return SendClientMessage(playerid, COLOR_ADMIN, "ERROR: This player is already jailed.");
if(targetid == playerid) return SendClientMessage(playerid, COLOR_RED, "You can't jail yourself!");
if(pInfo[targetid][pAdminLevel] > pInfo[playerid][pAdminLevel]) return SendClientMessage(playerid, COLOR_RED, "You can't jail higher level admins!");
format(str, sizeof(str), "%s has jailed %s for %d minute(s), reason: %s", PlayerName(playerid), PlayerName(targetid), minutes, reason);
SendSplitMessageToAll(COLOR_ADMIN, str);
JailTimer[targetid] = SetTimer("Unjail", minutes*60*1000, false);
SetPlayerPos(targetid, 264.4176, 77.8930, 1001.0391);
SetPlayerInterior(playerid, 6);
SetPlayerVirtualWorld(playerid, 99);
inJail[targetid] = true;
}
else return SendClientMessage(playerid, -1, "uhh ur not an admin so why are you trying to do that");
return 1;
}
/**************************************************************************************************************************************************/
CMD:unjail(playerid, params[])
{
if(pInfo[playerid][pAdminLevel] > 0)
{
new targetid, string[128];
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_ADMIN, "/unjail [ID]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_ADMIN, "ERROR: This player is not online.");
if(!inJail[playerid]) return SendClientMessage(playerid, COLOR_ADMIN, "ERROR: This player is not admin jailed.");
if(inJail[targetid])
{
format(string, sizeof(string), "%s has been released from admin jail by %s.", PlayerName(targetid), PlayerName(playerid));
SendSplitMessageToAll(COLOR_ADMIN, string);
SpawnPlayer(playerid);
SetPlayerInterior(playerid, 0);
inJail[playerid] = false;
KillTimer(JailTimer[playerid]);
SendClientMessage(playerid, COLOR_ADMIN, "SERVER: You've been released from admin jail.");
}
}
else return SendClientMessage(playerid, -1, "ey mang ur not an admin so cut it out");
return 1;
}
/**************************************************************************************************************************************************/
forward Unjail(playerid);
public Unjail(playerid)
{
SpawnPlayer(playerid);
SetPlayerInterior(playerid, 0);
inJail[playerid] = false;
KillTimer(JailTimer[playerid]);
SendClientMessage(playerid, COLOR_ADMIN, "SERVER: You've been released from admin jail.");
}
//global vars
new Float:AdminJailPos[MAX_PLAYERS][3],AdminJailInterior[MAX_PLAYERS],AdminJailVW[MAX_PLAYERS]; //these are only needed if you didn't plan on saving these variables
CMD:ajail(playerid, params[])
{
if(pInfo[playerid][pAdminLevel] > 0)
{
new targetid, minutes, reason[205], str[205],Float:pPos[3];
if(sscanf(params, "ris[205]", targetid, minutes, reason)) return SendClientMessage(playerid, COLOR_ADMIN, "USAGE: /ajail [id] [minutes] [reason]");
if(minutes <= 0 || minutes > 180) return SendClientMessage(playerid, COLOR_ADMIN, "ERROR: Minutes can't be less than 0 or more than 180!");
if(inJail[targetid]) return SendClientMessage(playerid, COLOR_ADMIN, "ERROR: This player is already jailed.");
if(targetid == playerid) return SendClientMessage(playerid, COLOR_RED, "You can't jail yourself!");
if(pInfo[targetid][pAdminLevel] > pInfo[playerid][pAdminLevel]) return SendClientMessage(playerid, COLOR_RED, "You can't jail higher level admins!");
GetPlayerPos(targetid,pPos[0],pPos[1],pPos[2]);
AdminJailPos[targetid][0] = pPos[0];
AdminJailPos[targetid][1] = pPos[1];
AdminJailPos[targetid][2] = pPos[2];
AdminJailInterior[targetid] = GetPlayerInterior(targetid);
AdminJailVW[targetid] = GetPlayerVirtualWorld(targetid);
format(str, sizeof(str), "%s has jailed %s for %d minute(s), reason: %s", PlayerName(playerid), PlayerName(targetid), minutes, reason);
SendSplitMessageToAll(COLOR_ADMIN, str);
JailTimer[targetid] = SetTimer("Unjail", minutes*60*1000, false);
SetPlayerPos(targetid, 264.4176, 77.8930, 1001.0391);
SetPlayerInterior(playerid, 6);
SetPlayerVirtualWorld(playerid, 99);
inJail[targetid] = true;
}
else return SendClientMessage(playerid, -1, "uhh ur not an admin so why are you trying to do that");
return 1;
}
forward Unjail(playerid);
public Unjail(playerid)
{
SpawnPlayer(playerid);
SetPlayerPos(playerid,AdminJailPos[playerid][0],AdminJailPos[playerid][1],AdminJailPos[playerid][2]);
SetPlayerInterior(playerid, AdminJailInterior[playerid]);
SetPlayerVirtualWorld(playerid,AdminJailVW[playerid]);
inJail[playerid] = false;
KillTimer(JailTimer[playerid]);
AdminJailPos[playerid][0] = 0.0;
AdminJailPos[playerid][1] = 0.0;
AdminJailPos[playerid][2] = 0.0;
AdminJailInterior[playerid] = 0;
AdminJailVW[playerid] = 0;
SendClientMessage(playerid, COLOR_ADMIN, "SERVER: You've been released from admin jail.");
}
GetPlayerPos(playerid, x, y, z);
Player[playerid][LastWorld] = GetPlayerVirtualWorld(playerid);
Player[playerid][LastInterior] = GetPlayerInterior(playerid);
Player[playerid][LastX] = x;
Player[playerid][LastY] = y;
Player[playerid][LastZ] = z;
SetPlayerPos(playerid, Player[playerid][LastX], Player[playerid][LastY], Player[playerid][LastZ]);
SetPlayerInterior(playerid, Player[playerid][LastInterior]);
SetPlayerVirtualWorld(playerid, Player[playerid][LastWorld]);
will give it a try my best friend
edit: gave me a bunch of errors, probably because of something on my end didnt work either :{ |
enum PlayerStatistics { LastX, Last Y, LastZ, LastWorld, LastInterior };