#include <a_samp>
static i_ServerMinutes;
static i_ServerHours;
static i_ServerDays;
static i_ServerMonths;
static i_ServerYears;
new Text:txtTimeDisp;
new Text:txtDateDisp;
forward ProcessGameTime();
public ProcessGameTime()
{
new string[128];
gettime(i_ServerHours, i_ServerMinutes);
getdate(i_ServerYears, i_ServerMonths, i_ServerDays);
format(string, sizeof string, "%02d:%02d", i_ServerHours, i_ServerMinutes);
TextDrawSetString(txtTimeDisp, string);
format(string, sizeof string, "%02d/%02d/%04d", i_ServerDays, i_ServerMonths, i_ServerYears);
TextDrawSetString(txtDateDisp, string);
SetWorldTime(i_ServerHours);
for(new i = 0; i < MAX_PLAYERS; i++)SetPlayerTime(i, i_ServerHours, i_ServerMinutes);
}
public OnFilterScriptInit()
{
txtDateDisp = TextDrawCreate(494.000000, 14.000000, "09/02/2014");
TextDrawBackgroundColor(txtDateDisp, 255);
TextDrawFont(txtDateDisp, 1);
TextDrawLetterSize(txtDateDisp, 0.239999, 1.200000);
TextDrawColor(txtDateDisp, -1);
TextDrawSetOutline(txtDateDisp, 1);
TextDrawSetProportional(txtDateDisp, 1);
txtTimeDisp = TextDrawCreate(551.000000, 22.000000, "20:54");
TextDrawBackgroundColor(txtTimeDisp, 255);
TextDrawFont(txtTimeDisp, 3);
TextDrawLetterSize(txtTimeDisp, 0.500000, 2.000000);
TextDrawColor(txtTimeDisp, -1);
TextDrawSetOutline(txtTimeDisp, 2);
TextDrawSetProportional(txtTimeDisp, 1);
ProcessGameTime();
SetTimer("ProcessGameTime", 1000, 1);
return 1;
}
public OnFilterScriptExit()
{
TextDrawHideForAll(txtTimeDisp);
TextDrawDestroy(txtTimeDisp);
TextDrawHideForAll(txtDateDisp);
TextDrawDestroy(txtDateDisp);
return 1;
}
public OnPlayerSpawn(playerid)
{
TextDrawShowForPlayer(playerid,txtTimeDisp);
TextDrawShowForPlayer(playerid,txtDateDisp);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
TextDrawHideForPlayer(playerid,txtTimeDisp);
TextDrawHideForPlayer(playerid,txtDateDisp);
return 1;
}
SetWorldTime(i_ServerHours);
Talves seria isso no FS:
pawn Код:
@EDIT Removi e nгo adiantou nada affe. |