Automatic Unjail, Jailtime is not being saved
#2

/jail command
pawn Code:
else
{
    format(jstring, sizeof(jstring), "[AdmCMD] %s has been jailed by Administrator %s for %d minute(s), [Reason: %s]", GetName(tID), GetName(playerid), time, reason);
    SCMTA(COLOR_LIGHTRED, jstring);
    PlayerInfo[tID][pAJailTime] = time*60;
    SetTimerEx("JailPlayer", 5000, false, "d", tID);
    SetTimerEx("Jail1", 1000, false, "d", tID);
    JailTime[tID] = time*60; // no needed
}
/unjail
pawn Code:
else
{
    format(jstring, sizeof(jstring), "[AdmCMD] %s has been unjailed by Administrator %s", GetName(tID), GetName(playerid));
    SCMTA(COLOR_LIGHTRED, jstring);
    PlayerInfo[tID][pAJailed] = 0;
    PlayerInfo[tID][pAJailTime] = 1;
    JailRelease(tID);
}

pawn Code:
public JailRelease(playerid)
{
    if(!IsPlayerConnected(playerid))
    {
        KillTimer(JailTimer[playerid]);
        return;
    }
    if(--PlayerInfo[playerid][pAJailTime] < 1)
    {
        PlayerInfo[playerid][pAJailed] = 0;
        KillTimer(JailTimer[playerid]);
        SetPlayerInterior(playerid, 0);
        SetPlayerPos(playerid, 0.0, 0.0, 0.0);
        SpawnPlayer(playerid);
        PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
        GameTextForPlayer(playerid, "~g~Released!", 3000, 0);
    }
}
Reply


Messages In This Thread
Automatic Unjail, Jailtime is not being saved - by AndySedeyn - 05.05.2014, 20:18
Re: Automatic Unjail, Jailtime is not being saved - by Jefff - 05.05.2014, 21:52
Re: Automatic Unjail, Jailtime is not being saved - by AndySedeyn - 06.05.2014, 21:09
Re: Automatic Unjail, Jailtime is not being saved - by Syncro - 07.05.2014, 00:18

Forum Jump:


Users browsing this thread: 1 Guest(s)