[HELP] Unjail countdown
#1

Hello, i know there is many of topics like this but most of them are trash ... Did not help at all so...
I have CMD:Jail and i want to implement Time Countdown into my unjail timer.

Here is the command:

Код:
CMD:jail(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid,0xFFFFFFFF,"");
	new string[512], reason[256], targetid, time;
	if(sscanf(params,"uis[50]", targetid , time, reason)) return SendClientMessage(playerid, 0xFFFFFFFF, "");
	if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,0xFFFFFFFF,"");
	if(PlayerInfo[playerid][pAdmin] < 6 && PlayerInfo[targetid][pAdmin]  == 6) return 
        SendClientMessage(playerid,0xFFFFFFFF,"");
	format(string, sizeof(string), "",GetName(playerid), GetName(targetid), time);
	SendClientMessageToAll(0xCC000022, string);
	format(string, sizeof(string), "", reason);
	SendClientMessageToAll(0xCC000022, string);
	SetPlayerInterior(targetid, 6);
	SetPlayerPos(targetid,264.1800,77.5989,1001.0391);
	PlayerInfo[targetid][pJailed] = 1;
	PlayerInfo[targetid][pJailedTime] = time*1000;
	UnJailTimer[targetid] = SetTimerEx("UnJailPlayer",time*1000,0,"i",targetid);
	JailTime[playerid] = SetTimerEx("UpdateJailTime",time*1000,0,"d",targetid);
        return 1;
}
As you can see i have 2 timers here ... I really want to have countdown and UnJailTimer in one.
Here is my timer

Код:
forward UnJailPlayer(playerid);
public UnJailPlayer(playerid)
{
	KillTimer(UnJailTimer[playerid]);
	SetPlayerInterior(playerid, 0);
	SetPlayerPos(playerid,1552.5085,-1675.7572,16.1953);
	GameTextForPlayer(playerid, "~w~BlahBlah~r~!", 3000, 6);
	PlayerInfo[playerid][pJailed] = 0;
	PlayerInfo[playerid][pJailedTime] = 0;
	return 1;
}
And finally... Where to put this?
Код:
    

        PlayerInfo[playerid][pJailedTime]--;
	new UnjailTime[20];
	format(UnjailTime,sizeof(UnjailTime),"~r~%d",PlayerInfo[playerid][pJailedTime]);
	GameTextForPlayer(playerid,UnjailTime,1000,1);
Any idea how to make really simple countdown system here?
Reply


Messages In This Thread
[HELP] Unjail countdown - by ThomasEvil - 03.06.2017, 22:52
Re: [HELP] Unjail countdown - by Jefff - 04.06.2017, 00:49
Re: [HELP] Unjail countdown - by ThomasEvil - 04.06.2017, 04:14
Re: [HELP] Unjail countdown - by silverms - 04.06.2017, 09:37
Re: [HELP] Unjail countdown - by Abagail - 04.06.2017, 15:24
Re: [HELP] Unjail countdown - by Jefff - 04.06.2017, 18:03
Re: [HELP] Unjail countdown - by ThomasEvil - 05.06.2017, 05:51
Re: [HELP] Unjail countdown - by ThomasEvil - 05.06.2017, 06:05
Re: [HELP] Unjail countdown - by UHPS - 05.06.2017, 06:14
Re: [HELP] Unjail countdown - by ThomasEvil - 05.06.2017, 06:30

Forum Jump:


Users browsing this thread: 1 Guest(s)