Helló.
Uncsiban megírtam egy szerver üzemidõ szkriptet ami nem nagy dolog, de lehet, hogy valakinek jól jön.
#include a_samp
#include zcmd
enum server {
uptime_timer,
uptime_weeks,
uptime_days,
uptime_hours,
uptime_minutes,
uptime_seconds
}
new SAMP[server];
forward Uptime(playerid);
public OnGameModeInit() { SAMP[uptime_timer] = SetTimer(\"Uptime\", 1000, true); return 1; }
public OnGameModeExit() { KillTimer(SAMP[uptime_timer]); return 1; }
public Uptime(playerid) {
SAMP[uptime_seconds] ++;
if(SAMP[uptime_seconds] == 60) { SAMP[uptime_minutes] ++; SAMP[uptime_seconds] = 0; }
if(SAMP[uptime_minutes] == 60) { SAMP[uptime_hours] ++; SAMP[uptime_minutes] = 0; }
if(SAMP[uptime_hours] == 24) { SAMP[uptime_days] ++; SAMP[uptime_hours] = 0; }
if(SAMP[uptime_days] == 7) { SAMP[uptime_weeks] ++; SAMP[uptime_days] = 0; }
return 1;
}
CMD:uptime(playerid) {
new str[256+1];
format(str, sizeof(str), \"{AFAFAF}Szerver üzemidõ: {DDDDDD}%d {AFAFAF}hét {DDDDDD}%02d {AFAFAF}nap {DDDDDD}%02d {AFAFAF}óra {DDDDDD}%02d {AFAFAF}perc {DDDDDD}%02d {AFAFAF}másodperc\", SAMP[uptime_weeks], SAMP[uptime_days], SAMP[uptime_hours], SAMP[uptime_minutes], SAMP[uptime_seconds]);
SendClientMessage(playerid, -1, str);
return 1;
}