SA-MP Forums Archive
Auto Unjail timer doesn't stop after getting kicked. - 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: Auto Unjail timer doesn't stop after getting kicked. (/showthread.php?tid=417334)



Auto Unjail timer doesn't stop after getting kicked. - Goldino - 20.02.2013

Hey guys, I was on my server with my friend testing out the jail function. I told him to jail me, then kick me. I came back to the server, and it says that I have been automatically released from jail. But whats weird, the timer should stop counting after I leave the server. Can you please help? Heres the auto un jail function:

Код:
public Unjail(playerid)
{
    if(Jailed[playerid] == 0)
		return 1;
    new playerName[24], String[128];
    GetPlayerName(playerid, playerName, sizeof(playerName));
    format(String, sizeof(String), "%s {FFFFFF}has been automatically released from Admin jail.", playerName);
    SendClientMessageToAll(0x009DFFFF, String);
    Jailed[playerid] = 0;
    SetPlayerInterior(playerid, 0);
    SetPlayerVirtualWorld(playerid, 0);
    SpawnPlayer(playerid);
    SetPlayerHealth(playerid, 100);
    KillTimer(JailTimer[playerid]);
    return 1;
}
Is it possible to kill the timer after the person disconnects, and comes back?

Please help


Re: Auto Unjail timer doesn't stop after getting kicked. - detter - 20.02.2013

You can use this topic a reference


Re: Auto Unjail timer doesn't stop after getting kicked. - Goldino - 20.02.2013

doesnt help me with anything?


Re: Auto Unjail timer doesn't stop after getting kicked. - Nuke547 - 20.02.2013

Basically, when setting the timer, set it as a variable.

Then, OnPlayerDisconnect, use KillTimer(Timer ID)