A gl_realtime FS-ben van a következõ sor a \"public UpdateTimeAndWeather()\" alatt:\"format(timestr,32,\"%02d:%02d\",hour,minute);\"Ha például azt akarod hogy két órával hamarabb sötétedjen, akkor írd át erre:\"format(timestr,32,\"%02d:%02d\",hour-2,minute);\"
SetPlayerTime(x,hour,minute);
A gl_realtime FS-ben van a következõ sor a \"public UpdateTimeAndWeather()\" alatt:\"format(timestr,32,\"%02d:%02d\",hour,minute);\"Ha például azt akarod hogy két órával hamarabb sötétedjen, akkor írd át erre:\"format(timestr,32,\"%02d:%02d\",hour-2,minute);\" Ugye tudod, hogy hülyeséget írtál? SetPlayerTime(x,hour,minute); Itt kell levenni kettõt, illetve amit Rupert is írt, az a textdrawhoz van. [/quote]Egyikõtöké sem volt teljesen jó válasz. #include <a_samp>#pragma tabsize 0//--------------------------------------------------new Text:txtTimeDisp;new hour, minute;new timestr[32];forward UpdateTime();//-------------------------------------------------- public UpdateTime(){ gettime(hour, minute); format(timestr,32,\"%02d:%02d\",hour,minute); TextDrawSetString(txtTimeDisp,timestr); SetWorldTime(hour); new x=0;while(x!=MAX_PLAYERS) { if(IsPlayerConnected(x) && GetPlayerState(x) != PLAYER_STATE_NONE) { SetPlayerTime(x,hour+2,minute); } x++;}}//--------------------------------------------------public OnGameModeInit(){// Init our text displaytxtTimeDisp = TextDrawCreate(605.0,25.0,\"00:00\");TextDrawUseBox(txtTimeDisp, 0);TextDrawFont(txtTimeDisp, 3);TextDrawSetShadow(txtTimeDisp,0); // no shadow TextDrawSetOutline(txtTimeDisp,2); // thickness 1 TextDrawBackgroundColor(txtTimeDisp,0x000000FF); TextDrawColor(txtTimeDisp,0xFFFFFFFF); TextDrawAlignment(txtTimeDisp,3);TextDrawLetterSize(txtTimeDisp,0.5,1.5);UpdateTime();SetTimer(\"UpdateTime\",1000 * 60,1);return 1;}//--------------------------------------------------public OnPlayerSpawn(playerid){TextDrawShowForPlayer(playerid,txtTimeDisp);gettime(hour, minute);SetPlayerTime(playerid,hour+2,minute);return 1;}//--------------------------------------------------public OnPlayerDeath(playerid, killerid, reason){ TextDrawHideForPlayer(playerid,txtTimeDisp);return 1;}//--------------------------------------------------public OnPlayerConnect(playerid){ gettime(hour, minute); SetPlayerTime(playerid,hour+2,minute); return 1;}//-------------------------------------------------- Ez itt a helyes, sikerült rájönnöm. Most a valós idõ megmaradt ami látszik textdrawban, de 2 órával hamarabb sötétedik (Olyan 18-19 óra körül).Lényeg, hogy sikerült és mostmár királyság van. Azért köszönöm a segítséget, megy a +.Téma Megoldva
#include <a_samp>#pragma tabsize 0//--------------------------------------------------new Text:txtTimeDisp;new hour, minute;new timestr[32];forward UpdateTime();//-------------------------------------------------- public UpdateTime(){ gettime(hour, minute); format(timestr,32,\"%02d:%02d\",hour,minute); TextDrawSetString(txtTimeDisp,timestr); SetWorldTime(hour); new x=0;while(x!=MAX_PLAYERS) { if(IsPlayerConnected(x) && GetPlayerState(x) != PLAYER_STATE_NONE) { SetPlayerTime(x,hour+2,minute); } x++;}}//--------------------------------------------------public OnGameModeInit(){// Init our text displaytxtTimeDisp = TextDrawCreate(605.0,25.0,\"00:00\");TextDrawUseBox(txtTimeDisp, 0);TextDrawFont(txtTimeDisp, 3);TextDrawSetShadow(txtTimeDisp,0); // no shadow TextDrawSetOutline(txtTimeDisp,2); // thickness 1 TextDrawBackgroundColor(txtTimeDisp,0x000000FF); TextDrawColor(txtTimeDisp,0xFFFFFFFF); TextDrawAlignment(txtTimeDisp,3);TextDrawLetterSize(txtTimeDisp,0.5,1.5);UpdateTime();SetTimer(\"UpdateTime\",1000 * 60,1);return 1;}//--------------------------------------------------public OnPlayerSpawn(playerid){TextDrawShowForPlayer(playerid,txtTimeDisp);gettime(hour, minute);SetPlayerTime(playerid,hour+2,minute);return 1;}//--------------------------------------------------public OnPlayerDeath(playerid, killerid, reason){ TextDrawHideForPlayer(playerid,txtTimeDisp);return 1;}//--------------------------------------------------public OnPlayerConnect(playerid){ gettime(hour, minute); SetPlayerTime(playerid,hour+2,minute); return 1;}//--------------------------------------------------