19.02.2014, 20:30
Bom, alguem me diz como nesse FS...
PHP код:
#include <a_samp>
static i_ServerSeconds;
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, i_ServerSeconds);
getdate(i_ServerYears, i_ServerMonths, i_ServerDays);
format(string, sizeof string, "%02d:%02d:%02d", i_ServerHours-4, i_ServerMinutes, i_ServerSeconds);
TextDrawSetString(txtTimeDisp, string);
if(i_ServerHours == 0)
{
format(string, sizeof string, "%02d:%02d:%02d", 20, i_ServerMinutes, i_ServerSeconds);
TextDrawSetString(txtTimeDisp, string);
format(string, sizeof string, "%02d/%02d/%04d", i_ServerDays , i_ServerMonths, i_ServerYears);
TextDrawSetString(txtDateDisp, string);
TextDrawShowForAll(txtTimeDisp);
}
if(i_ServerHours == 1)
{
format(string, sizeof string, "%02d:%02d:%02d", 21, i_ServerMinutes, i_ServerSeconds);
TextDrawSetString(txtTimeDisp, string);
TextDrawShowForAll(txtTimeDisp);
}
if(i_ServerHours == 2)
{
format(string, sizeof string, "%02d:%02d:%02d", 22, i_ServerMinutes, i_ServerSeconds);
TextDrawSetString(txtTimeDisp, string);
TextDrawShowForAll(txtTimeDisp);
}
if(i_ServerHours == 4)
{
format(string, sizeof string, "%02d:%02d:%02d", 23, i_ServerMinutes, i_ServerSeconds);
TextDrawSetString(txtTimeDisp, string);
TextDrawShowForAll(txtTimeDisp);
}
format(string, sizeof string, "%02d/%02d/%04d", i_ServerDays, i_ServerMonths, i_ServerYears);
TextDrawSetString(txtDateDisp, string);
}
public OnFilterScriptInit()
{
txtTimeDisp = TextDrawCreate(632.0,25.0,"--:--:--");
TextDrawUseBox(txtTimeDisp, 0);
TextDrawFont(txtTimeDisp, 3);
TextDrawSetShadow(txtTimeDisp,0);
TextDrawSetOutline(txtTimeDisp,2);
TextDrawBackgroundColor(txtTimeDisp,0x000000FF);
TextDrawColor(txtTimeDisp,0xFFFFFFFF);
TextDrawAlignment(txtTimeDisp,3);
TextDrawLetterSize(txtTimeDisp,0.5,1.5);
txtDateDisp = TextDrawCreate(620.0,5.0,"00/00/0000");
TextDrawUseBox(txtDateDisp, 0);
TextDrawFont(txtDateDisp, 3);
TextDrawSetShadow(txtDateDisp,0);
TextDrawSetOutline(txtDateDisp,2);
TextDrawBackgroundColor(txtDateDisp,0x000000FF);
TextDrawColor(txtDateDisp,0xFFFFFFFF);
TextDrawAlignment(txtDateDisp,3);
TextDrawLetterSize(txtDateDisp,0.5,1.5);
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;
}