/ajail help.
#1

Okay, so I'd like an /ajail command that is usable by level 1 administrators in my server.

USAGE: /ajail [playerid] [time] [reason]

I have tried to do this, but it doesn't seem to work. I would also like them to teleport to these co-ordinates when I type it:

1814.8334,3246.8838,3.0369,125.6988,0,0,0,0,0,0);

A also need an /arelease [playerid] which will teleport them to Unity Station.
Reply
#2

First, do you have a user system? An account system that is.
Reply
#3

Yes I do. The admin levels in there are [pAdminLevel]
Reply
#4

May I see your code?

I recommend looking at other admin filterscripts and such. I'll just tell you what you need to do in my own eyes.

You'll need to add pJailed, pJailTime for your accounts.

OnPlayerSpawn,

if(PlayerInfo[playerid][pJailed] == 1)
{
SetPlayerPos(playerid, X, Y, Z);
SendClientMessage(playerid, COLOR_RED, "You've been sent back to ajail due to an unfinished sentence");
return 1;
}

// Also add the timers, ect. Just look at admin filterscripts, you'll figure it out.
Reply
#5

If I could figure it out like that I'd of done it already. I need a piece of code that I can use to take my information from. Once the end product is there infront of me, I understand it for the next time I need to do it.
Reply
#6

Like I said, find an administrator filterscript or a gamemode, /ajail commands can be found in there.
Reply
#7

pawn Код:
CMD:ajail(playerid, params[])
{
    new Player;
    if(sscanf(params, "u", Player)) return SendClientMessage(playerid, -1, "Usage: /ajail <playerid>");
    if(pInfo[playerid][pAdminLevel] = 0) return SendClientMessage(playerid, -1, "You are not authorized to use     this command.");
    SetPlayerPos(Player, 1814.8334,3246.8838,3.0369);
    return 1;
}
I do not know what system you are using so I can not tell you how to properly do this.
Reply
#8

Quote:
Originally Posted by SilencedPistol
Посмотреть сообщение
Okay, so I'd like an /ajail command that is usable by level 1 administrators in my server.

USAGE: /ajail [playerid] [time] [reason]

I have tried to do this, but it doesn't seem to work. I would also like them to teleport to these co-ordinates when I type it:

1814.8334,3246.8838,3.0369,125.6988,0,0,0,0,0,0);

A also need an /arelease [playerid] which will teleport them to Unity Station.
Do you also need a coffee, a pizza or a hotdog? Jk.

pawn Код:
CMD:jail(playerid, params[])
{
    if(pAdminLevel[playerid] == 1)
    {
    new id,time,reason[128],PlayerName[MAX_PLAYER_NAME],GPlayerName[MAX_PLAYER_NAME];
    if(sscanf(params,"uds[128]",id,time,reason)) return SCM(playerid, -1, "{F70505}Usage: {FFFFFF}/jail <playerid> <time in minutes> <reason>");
    if(!IsPlayerConnected(id)) return SCM(playerid, red, "ERROR: Player is not connected.");
    if(time < 0 || time > 1000)return SCM(playerid,0xff0000FF,"Error: Max jail time: 1000 minutes - Min: 1.");
    GetPlayerName(id, PlayerName, sizeof(PlayerName));
    GetPlayerName(playerid, GPlayerName, sizeof(GPlayerName));
    new szString[200];
    format(szString, sizeof(szString), "** Admin %s (%d) has jailed %s (%d) for %d minutes. Reason: %s", GPlayerName,playerid,PlayerName,id,time,reason);
    SendClientMessageToAll(pink, szString);
    SetPlayerPos(id, 1814.8334,3246.8838,3.0369,125.6988); //Fix your coordinates. Must be X, Y, Z.
    JailTimer[id] = SetTimerEx("Unjail",time*60000, false, "i", id);
    }
    return 1;
}

//On top:
forward Unjail(playerid);
new JailTimer[MAX_PLAYERS];

public Unjail(playerid)
{
  SetPlayerInterior(playerid, 0);
  SetPlayerVirtualWorld(playerid, 0);
  KillTimer(JailTimer[playerid]);
  SetPlayerPos(playerid,YOUR_COORDINATES);
  return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)