19.02.2014, 23:57
Can someone make me a cmd where you do /ajail and it sends you to any position, ill edit the postition just need it.
I had this one but it sent you to a random jail cell in the rp prison so i removed the random cell script lines and left with this
CMD:ajail(playerid, params[])
{
new playerb, time, string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on Admin Duty.");
if(sscanf(params, "uis[64]", playerb, time, params)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /ajail [playerid] [time] [reason]");
if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
if(time == 0)
{
if(!PlayerInfo[playerb][pPrison]) return SendClientMessage(playerid, COLOR_GREY, "Player is not prisoned.");
ClearDodWantedLevels(playerb);
ResetPlayerWeapons(playerb);
ResetDodWeapons(playerb);
SetPlayerColor(playerb, TRANSPARENT_WHITE);
PlayerInfo[playerb][pPrison] = 0;
PlayerInfo[playerb][pPrisonTime] = time;
format(PlayerInfo[playerb][pPrisonReason], 64, "");
format(PlayerInfo[playerb][pPrisonBy], 32, "");
SetPlayerInterior(playerb, 0);
SetPlayerVirtualWorld(playerb, 0);
SetPlayerFacingAngle(playerb, 357.5062);
SetPlayerPos(playerb, 2575.5322, 2696.0835, 25.6673);
SetCameraBehindPlayer(playerb);
format(string, sizeof(string), "AdmCmd: %s has been released by %s, reason: %s", RPN(playerb), RPN(playerid), params);
SendClientMessageToAll(COLOR_LIGHTRED, string);
Log("logs/prison.log", string);
SendClientMessage(playerb, COLOR_LIGHTBLUE, " You have been released by an administrator, try to be a better player.");
TogglePlayerControllable(playerb, 1);
BUT IT AJAILS YOU IN THE POSITION YOU WHERE BEFORE AND WHEN YOU ARE UN ADMIN JAILED IT TAKES YOU TO THE POSITION I SET
I had this one but it sent you to a random jail cell in the rp prison so i removed the random cell script lines and left with this
CMD:ajail(playerid, params[])
{
new playerb, time, string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on Admin Duty.");
if(sscanf(params, "uis[64]", playerb, time, params)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /ajail [playerid] [time] [reason]");
if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
if(time == 0)
{
if(!PlayerInfo[playerb][pPrison]) return SendClientMessage(playerid, COLOR_GREY, "Player is not prisoned.");
ClearDodWantedLevels(playerb);
ResetPlayerWeapons(playerb);
ResetDodWeapons(playerb);
SetPlayerColor(playerb, TRANSPARENT_WHITE);
PlayerInfo[playerb][pPrison] = 0;
PlayerInfo[playerb][pPrisonTime] = time;
format(PlayerInfo[playerb][pPrisonReason], 64, "");
format(PlayerInfo[playerb][pPrisonBy], 32, "");
SetPlayerInterior(playerb, 0);
SetPlayerVirtualWorld(playerb, 0);
SetPlayerFacingAngle(playerb, 357.5062);
SetPlayerPos(playerb, 2575.5322, 2696.0835, 25.6673);
SetCameraBehindPlayer(playerb);
format(string, sizeof(string), "AdmCmd: %s has been released by %s, reason: %s", RPN(playerb), RPN(playerid), params);
SendClientMessageToAll(COLOR_LIGHTRED, string);
Log("logs/prison.log", string);
SendClientMessage(playerb, COLOR_LIGHTBLUE, " You have been released by an administrator, try to be a better player.");
TogglePlayerControllable(playerb, 1);
BUT IT AJAILS YOU IN THE POSITION YOU WHERE BEFORE AND WHEN YOU ARE UN ADMIN JAILED IT TAKES YOU TO THE POSITION I SET