03.06.2017, 22:52
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:
As you can see i have 2 timers here ... I really want to have countdown and UnJailTimer in one.
Here is my timer
And finally... Where to put this?
Any idea how to make really simple countdown system here?
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; }
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; }
Код:
PlayerInfo[playerid][pJailedTime]--; new UnjailTime[20]; format(UnjailTime,sizeof(UnjailTime),"~r~%d",PlayerInfo[playerid][pJailedTime]); GameTextForPlayer(playerid,UnjailTime,1000,1);