SA-MP Forums Archive
Admin Jail issue.. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Admin Jail issue.. (/showthread.php?tid=377009)



Admin Jail issue.. - Benzke - 12.09.2012

Okay, Admin Jail works fine but the problem is it Jails me myself..
Like /ajail 2 1 which is Jail id 2 for 1 min but instead of jailing id 2, It jails me..

pawn Код:
CMD:ajail(playerid, params[])
{
        new id, mins, str[128];
        new JailTimer[MAX_PLAYERS];
        if(PlayerInfo[playerid][Adminlevel] < 2) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
        if(sscanf(params, "ud", id, mins)) return SendClientMessage(playerid, COLOR_RED, "[SYNTAX]: /ajail [PlayerID/PartOfName] [Mins]");
        if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Invalid Player ID");
        SetPlayerPos(playerid, 264.4176, 77.8930, 1001.0391);
        SetPlayerInterior(playerid, 6);
        JailTimer[id] = SetTimerEx("Unjail", mins*60*1000, 0, "d", id);
        format(str, sizeof(str), "You jailed %s for %d mins.", GetName(id), mins);
        SendClientMessage(playerid, COLOR_RED, str);
        format(str, sizeof(str), "%s jailed you for %d mins.", GetName(playerid), mins);
        SendClientMessage(id, COLOR_RED, str);
        format(str, sizeof(str), "ADMIN %s has jailed %s for %d mins!", GetName(playerid), GetName(id), mins);
        SendClientMessageToAll(COLOR_RED, str);
        return 1;
}



AW: Admin Jail issue.. - BiosMarcel - 12.09.2012

Not:
SetPlayerPos(playerid, 264.4176, 77.8930, 1001.0391);
SetPlayerInterior(playerid, 6);

SO is it right:
SetPlayerPos(id, 264.4176, 77.8930, 1001.0391);
SetPlayerInterior(id, 6);

If you jail someone with this command he can break out with a relog