Hallo Breadfish
Ich habe momentan das Problem, dass der Ingametimestamp ein anderer ist als der vom Webserver.
Beide liegen auf dem selben Server.
In PHP hole ich mir den Timestamp so
Auf dem Gameserver so: (Ist von einem Timeban System, vor langer Zeit mal irgendwo gefunden )
stock Get_Time()
{
new fxban_int_hour,fxban_int_minute,fxban_int_second,fxban_int_year,fxban_int_month,fxban_int_day;
gettime(fxban_int_hour, fxban_int_minute, fxban_int_second);
getdate(fxban_int_year, fxban_int_month, fxban_int_day);
return FB_mktime(fxban_int_hour,fxban_int_minute,fxban_int_second,fxban_int_day,fxban_int_month,fxban_int_year);
}
stock FB_mktime(hour1,minute1,second1,day1,month1,year1) {
new timestamp2;
timestamp2 = second1 + (minute1 * 60) + (hour1 * 3600);
new days_of_month[12];
if ( ((year1 % 4 == 0) && (year1 % 100 != 0)) || (year1 % 400 == 0) ) { days_of_month = {31,29,31,30,31,30,31,31,30,31,30,31}; }
else { days_of_month = {31,28,31,30,31,30,31,31,30,31,30,31}; }
new days_this_year = 0; days_this_year = day1;
if(month1 > 1) {
for(new i=0; i<month1-1;i++) {
days_this_year += days_of_month[i];
}
}
timestamp2 += days_this_year * 86400;
for(new j=1970;j<year1;j++) {
timestamp2 += 31536000;
if ( ((year1 % 4 == 0) && (year1 % 100 != 0)) || (year1 % 400 == 0) ) timestamp2 += 86400;
}
return timestamp2;
}
Gruß