Nincs teszt.
new
time_spent_in_game[MAX_PLAYERS],
weeks[MAX_PLAYERS],
days[MAX_PLAYERS],
hours[MAX_PLAYERS],
seconds[MAX_PLAYERS];
forward TimeSpentInGame(playerid);
public OnPlayerConnect(playerid) {
time_spent_in_game[playerid] = SetTimerEx(\"TimeSpentInGame\", 1000, true, \"i\", playerid);
return 1;
}
public OnPlayerDisconnect(playerid, reason) {
KillTimer(time_spent_in_game[playerid]);
return 1;
}
public TimeSpentInGame(playerid) {
seconds[playerid] ++;
if(seconds[playerid] == 60) { minutes[playerid] ++; seconds[playerid] = 0; }
if(minutes[playerid] == 60) { hours[playerid] ++; minutes[playerid] = 0; }
if(hours[playerid] == 24) { days[playerid] ++; hours[playerid] = 0; }
if(days[playerid] == 7) { weeks[playerid] ++; days[playerid] = 0; }
return 1;
}
CMD:eltoltottido(playerid, params[]) {
new str[128];
SendClientMessage(playerid, 0xFFFF99AA, \"Csatlakozástól számítva eltöltött idõ a szerveren:\");
format(str, sizeof(str), \"%02d hét %02d nap %02d óra %02d perc %02d másodperc\", weeks[playerid], days[playerid], hours[playerid], minutes[playerid], seconds[playerid]);
SendClientMessage(playerid, -1, str);
return 1;
}