Hallo,
ich bin mit meinem Projekt auf einen Server gezogen und seitdem hängt die Uhrzeit und auch die Worldtime 2 Stunden hinterher.
Also wenn die Uhrzeit in Deutschland 13 Uhr ist, ist sie auf dem Server erst bei 11 Uhr.
Wie kann ich dieses Problem beheben?
Hier mal die Stellen, wo die Uhrzeit in meinem Script vorkommt:
public UpdateTime()
{
gettime(hour, minute);
format(timestr,32,"%02d:%02d",hour,minute);
TextDrawSetString(txtTimeDisp,timestr);
new x=0;
while(x!=MAX_PLAYERS) {
x++;
}
}
public OnGameModeInit()
{
gettime(ghour, gminute, gsecond);
FixHour(ghour);
ghour = shifthour;
if(!realtime)
{
SetWorldTime(wtime);
}
if (realtime)
{
new tmphour;
new tmpminute;
new tmpsecond;
gettime(tmphour, tmpminute, tmpsecond);
FixHour(tmphour);
tmphour = shifthour;
SetWorldTime(tmphour);
}
}
public SyncTime()
{
new string[64];
new tmphour;
new tmpminute;
new tmpsecond;
gettime(tmphour, tmpminute, tmpsecond);
FixHour(tmphour);
tmphour = shifthour;
if ((tmphour > ghour) || (tmphour == 0 && ghour == 23))
{
format(string, sizeof(string), "SERVER: Es ist nun %d:00 Uhr ",tmphour);
BroadCast(COLOR_WHITE,string);
ghour = tmphour;
// PayDay();
if (realtime)
{
SetWorldTime(tmphour);
}
}
}
if(strcmp(cmd, "/time", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new mtext[20];
new year, month,day;
getdate(year, month, day);
if(month == 1) { mtext = "Januar"; }
else if(month == 2) { mtext = "Februar"; }
else if(month == 3) { mtext = "März"; }
else if(month == 4) { mtext = "April"; }
else if(month == 5) { mtext = "Mai"; }
else if(month == 6) { mtext = "Juni"; }
else if(month == 7) { mtext = "Juli"; }
else if(month == 8) { mtext = "August"; }
else if(month == 9) { mtext = "September"; }
else if(month == 10) { mtext = "Oktober"; }
else if(month == 11) { mtext = "November"; }
else if(month == 12) { mtext = "Dezember"; }
new minuite,second;
gettime(hour,minuite,second);
FixHour(hour);
hour = shifthour;
if (minuite < 10)
{
if (PlayerInfo[playerid][pJailTime] > 0)
{
format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:0%d~g~|~n~~w~Knastzeit: %d sek", day, mtext, hour, minuite, PlayerInfo[playerid][pJailTime]-10);
}
else
{
format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:0%d~g~|", day, mtext, hour, minuite);
}
}
else
{
if (PlayerInfo[playerid][pJailTime] > 0)
{
format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:%d~g~|~n~~w~Knastzeit: %d sek", day, mtext, hour, minuite, PlayerInfo[playerid][pJailTime]-10);
}
else
{
format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:%d~g~|", day, mtext, hour, minuite);
}
}
GameTextForPlayer(playerid, string, 5000, 1);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Gespielte Zeit seit PayDay: %d", PlayerInfo[playerid][pPayDay]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s schaut auf seine Uhr.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
ApplyAnimation(playerid,"COP_AMBIENT","Coplook_watch",4.1,0,0,0,0,0);
}
return 1;
}
Hoffentlich kann mir jemand helfen
MfG