07.02.2019, 17:45
Time script

PHP Code:
#include <a_samp>
static timer;
static Text:time;
public OnFilterScriptInit()
{
time = TextDrawCreate(552.900207, 32.800006, "00:00");
TextDrawLetterSize(time, 0.410333, 2.321777);
TextDrawAlignment(time, 1);
TextDrawColor(time, 255);
TextDrawSetShadow(time, 0);
TextDrawSetOutline(time, 1);
TextDrawBackgroundColor(time, -2139062017);
TextDrawFont(time, 0);
TextDrawSetProportional(time, 1);
timer = SetTimer("Update_Time", 1000, true);
return 1;
}
public OnFilterScriptExit()
{
TextDrawDestroy(time);
KillTimer(timer);
return 1;
}
public OnPlayerConnect(playerid)
{
TextDrawShowForPlayer(playerid, time);
return 1;
}
forward Update_Time();
public Update_Time()
{
new str[6], h, m;
gettime(h, m);
format(str, sizeof(str), "%02d:%02d", h, m);
TextDrawSetString(time, str);
return 1;
}