..... meleg van bocsi.
new d[MAX_PLAYERS][3];
new EltoltottIdo[MAX_PLAYERS];
forward Szamlalo(playerid);
forward Kiiras(playerid);
public OnPlayerConnect(playerid)
{
EltoltottIdo[playerid] = SetTimerEx(\"Szamlalo\",1000,1,\"i\",playerid);
SetTimerEx(\"Kiiras\",randomEx(350000,600000),1,\"i\",playerid);
}
public OnPlayerDisconnect(playerid)
{
KillTimer(EltoltottIdo[playerid]);
}
public Szamlalo(playerid)
{
d[playerid][0]++;
if(d[playerid][0] == 60)
{
d[playerid][0] = 0;
d[playerid][1]++;
}
if(d[playerid][1] == 60)
{
d[playerid][0] = 0;
d[playerid][1] = 0;
d[playerid][2]++;
}
return 1;
}
public Kiiras(playerid)
{
new string[256];
format(string,sizeof(string),\"A Szerveren eltöltött idõd: %02i óra,%02i perc,%02i másodperc\",d[playerid][2],d[playerid][1],d[playerid][0]);
SendClientMessage(playerid,-1,string);
return 1;
}
stock randomEx(min, max)
{
//Credits to y_less
new rand = random(max-min)+min;
return rand;
}