01.03.2014, 01:23
O Relуgia vai atй as 10 quando chega 11 horas se n me engano da um bug no rlg fika -1 n seei oq e host sampgs da franзa alguem me ajuda no codigo obs quando da uns 1 hr desbuga parec,
PHP код:
#include <a_samp>
static i_ServerSeconds;
static i_ServerMinutes;
static i_ServerHours;
new Text:txtTimeDisp;
forward ProcessGameTime();
public ProcessGameTime()
{
new string[128];
gettime(i_ServerHours, i_ServerMinutes, i_ServerSeconds);
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);
}
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);
}
return 1;
}
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);
ProcessGameTime();
SetTimer("ProcessGameTime", 1000, 1);
return 1;
}
public OnFilterScriptExit()
{
TextDrawHideForAll(txtTimeDisp);
TextDrawDestroy(txtTimeDisp);
return 1;
}
public OnPlayerSpawn(playerid)
{
TextDrawShowForPlayer(playerid,txtTimeDisp);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
TextDrawHideForPlayer(playerid,txtTimeDisp);
return 1;
}