![](images/misc/post_spacer.gif) |
AlliedModders Donor
|
![Old](images/statusicon/post_old.svg)
02-06-2021
, 06:08
Re: Time check
|
#3
|
Quote:
Originally Posted by FAQU
PHP Code:
public void OnPluginStart() { CreateTimer(60.0, Timer_Checktime, _, TIMER_REPEAT); }
public Action Timer_Checktime(Handle timer) { char time[32]; int timestamp = GetTime(); FormatTime(time, sizeof(time), "%H:%M", timestamp); if (StrEqual(time, "17:30")) { // do stuff } }
|
Not working.
PHP Code:
public Action Timer_Checktime(Handle timer) { char time[32]; int timestamp = GetTime(); FormatTime(time, sizeof(time), "%H:%M", timestamp); for (int i = 1; i <= MaxClients; i++) { if (IsClientInGame(i)) { if(StrEqual(time, "00:00")) { SetHudTextParams(-1.0, 0.3, 5.0, 74, 169, 34, 255, 0, 0.1, 0.1, 0.1); ShowHudText(i, 5, "Clock: 00:00"); } } } }
Last edited by jugule; 02-06-2021 at 06:10.
|
|
|
|