Wysłany: 2012-04-28, 22:37
:Tyfus:
Wiek: 28 Na forum: 5260 dni Posty: 5
Nick w MP: :Tyfus:)
Piwa : 1
Witam chce si? spyta? , jaki kod jest ?eby mo?na by?o sprawdza? na Czas Pobytu na Serwerze ( 00h:00min:00sec)
Prosze o Pomoc!
Wysłany: 2012-04-29, 21:38
Combacior
Wiek: 29 Na forum: 5796 dni Posty: 1516
Piwa : 2161
G?ra mapy
Kod: new Sek[MAX_PLAYERS, Min[MAX_PLAYERS], Hour[MAX_PLAYERS];
OnPlayerConnect
Kod: SetTimerEx("Czas",1000,0,"i",playerid);
Gdzie? na dole mapki
Kod: forward Czas(playerid);
public Czas(playerid)
{
Sek[playerid]++;
if(Sek[playerid] > 60)
{
Sek[playerid] = 0;
Min[playerid]++;
}
if(Min[playerid] == 60)
{
Min[playerid] = 0;
Hour[playerid]++;
}
TextDrawSetString(...)
return 1;
}
P??niej w textdrawie, nie wiem gdzie chcesz to mie?, sformatuj sobie ten tekst w publicu Czas
Wysłany: 2012-04-30, 19:46
:Tyfus:
Wiek: 28 Na forum: 5260 dni Posty: 5
Nick w MP: :Tyfus:)
Piwa : 1
Ale co..?
A zreszt? nie wa?ne
Chodzi mi o to ?e na przyk?ad wpisuje /timehere [nick] i mi si? wy?wietla ( Timehere Gracza 00h:00min:00sec )
Wysłany: 2012-05-03, 19:23
Quis
Wszechwiedzący
Wiek: 31 Na forum: 5146 dni Posty: 464
Nick w MP: Quis
Piwa : 1110
na g?rze mapy:
Kod: new GameStart[MAX_PLAYERS];
w OnPlayerConnect:
Kod: GameStart[playerid] = gettime();
Komenda:
Kod: CMD:timehere(playerid, params[])
{
if(!IsPlayerAdmin(playerid))
{
SendClientMessage(playerid, RED, "Nie jeste? administratorem.");
return 1;
}
new checkid = strval(params);
if(!IsPlayerConnected(checkid))
{
SendClientMessage(playerid, RED, "Podany gracz nie jest pod??czony.");
return 1;
}
new hours, minutes, seconds;
ConvertSeconds((gettime()-GameStart[checkid]), hours, minutes, seconds);
new checkName[MAX_PLAYER_NAME];
GetPlayerName(checkid, checkName, MAX_PLAYER_NAME);
new msg[128];
format(msg, sizeof msg, "Czas gry gracza %s: %02d:%02d:%02d", checkName, hours, minutes, seconds);
SendClientMessage(playerid, GREEN, msg);
return 1;
}
Gdzie? na dole mapy:
Kod: stock ConvertSeconds(seconds, &hours, &minutes, &sec) //by Quis
{
new hrs = floatround(seconds/3600, floatround_floor);
hours = hrs;
new mins = floatround((seconds-(hours*3600))/60, floatround_floor);
minutes = mins;
sec = seconds-((hours*3600)+(minutes*60));
return 1;
}
Przepraszam je?li b?dzie b??d, ale ca?? komend? pisa?em w przegl?darce
Tagi: timehere
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: