Szerző Téma: Idõ gl_realtime szerint  (Megtekintve 1404 alkalommal)

Idõ gl_realtime szerint
« Dátum: 2012. Június 16. - 10:28:03 »
0 Show voters
Hogy lehet megcsinálni, hogy a szerver idõ a gl_realtime szerint menjen?

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
Idõ gl_realtime szerint
« Válasz #1 Dátum: 2012. Június 16. - 13:07:23 »
0 Show voters
Nézzd ki belõle. :D

Idõ gl_realtime szerint
« Válasz #2 Dátum: 2012. Június 16. - 13:25:44 »
0 Show voters
Én úgy értem, hogy a gl_realtime ideje szerint legyen napal és éjszaka. 

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
Idõ gl_realtime szerint
« Válasz #3 Dátum: 2012. Június 16. - 13:31:40 »
+1 Show voters

//
// Keeps the in game time synced to the server\'s time and
// draws the current time on the player\'s hud using a textdraw/
// (1 minute = 1 minute real world time)
//
//  (c) 2009-2012 SA-MP Team
#include <a_samp>
#pragma tabsize 0
//--------------------------------------------------
new Text:txtTimeDisp;
new hour, minute;
new timestr[32];
forward UpdateTimeAndWeather();
//--------------------------------------------------
new fine_weather_ids[] = {1,2,3,4,5,6,7,12,13,14,15,17,18,24,25,26,27,28,29,30,40};
new foggy_weather_ids[] = {9,19,20,31,32};
new wet_weather_ids[] = {8};
stock UpdateWorldWeather()
{
new next_weather_prob = random(100);
if(next_weather_prob < 70)       SetWeather(fine_weather_ids[random(sizeof(fine_weather_ids))]);
else if(next_weather_prob < 95) SetWeather(foggy_weather_ids[random(sizeof(foggy_weather_ids))]);
else                     SetWeather(wet_weather_ids[random(sizeof(wet_weather_ids))]);
}
//--------------------------------------------------
//new last_weather_update=0;
public UpdateTimeAndWeather()
{
// Update time
    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,minute);
 }
 x++;
}
/* Update weather every hour
if(last_weather_update == 0) {
    UpdateWorldWeather();
}
last_weather_update++;
if(last_weather_update == 60) {
    last_weather_update = 0;
}*/
}
//--------------------------------------------------
public OnGameModeInit()
{
// Init our text display
txtTimeDisp = 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);
UpdateTimeAndWeather();
SetTimer(\"UpdateTimeAndWeather\",1000 * 60,1);
return 1;
}
//--------------------------------------------------
public OnPlayerSpawn(playerid)
{
TextDrawShowForPlayer(playerid,txtTimeDisp);
gettime(hour, minute);
SetPlayerTime(playerid,hour,minute);
return 1;
}
//--------------------------------------------------
public OnPlayerDeath(playerid, killerid, reason)
{
    TextDrawHideForPlayer(playerid,txtTimeDisp);
return 1;
}
//--------------------------------------------------
public OnPlayerConnect(playerid)
{
    gettime(hour, minute);
    SetPlayerTime(playerid,hour,minute);
    return 1;
}
//--------------------------------------------------

 
Ezt simán átt lehet írni a sajátodéra.. :)

Idõ gl_realtime szerint
« Válasz #4 Dátum: 2012. Június 16. - 13:33:44 »
0 Show voters
hát én dt-bõl kiszedtem neked, rem mükszik
 
new realtime = 1;

 

if (realtime)
{
new tmphour;
new tmpminute;
new tmpsecond;
gettime(tmphour, tmpminute, tmpsecond);
FixHour(tmphour);
tmphour = shifthour;
SetWorldTime(tmphour);
}

 


SetTimer(\"RealTime\", 60000, 1);
return 1;
}

 

public SyncTime()
{
new tmphour;
new tmpminute;
new tmpsecond;
gettime(tmphour, tmpminute, tmpsecond);
FixHour(tmphour);
tmphour = shifthour;
if ((tmphour > ghour) || (tmphour == 0 && ghour == 23))
{
ghour = tmphour;
if (realtime)
{
   SetWorldTime(tmphour +IDOHOZZAADAS);
}
}
}

 
remélem ez kell neked :)  :mistrust:
ha  :no: akk keresünk más megoldást
off: látom megelõztek  >:D ^-^

Idõ gl_realtime szerint
« Válasz #5 Dátum: 2012. Június 16. - 14:08:24 »
0 Show voters
Idézetet írta: norbee0170 date=1339846424\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"22905\" data-ipsquote-contentclass=\"forums_Topic
hát én dt-bõl kiszedtem neked, rem mükszik
 
new realtime = 1;

 

if (realtime)
{
new tmphour;
new tmpminute;
new tmpsecond;
gettime(tmphour, tmpminute, tmpsecond);
FixHour(tmphour);
tmphour = shifthour;
SetWorldTime(tmphour);
}

 


SetTimer(\"RealTime\", 60000, 1);
return 1;
}

 

public SyncTime()
{
new tmphour;
new tmpminute;
new tmpsecond;
gettime(tmphour, tmpminute, tmpsecond);
FixHour(tmphour);
tmphour = shifthour;
if ((tmphour > ghour) || (tmphour == 0 && ghour == 23))
{
ghour = tmphour;
if (realtime)
{
   SetWorldTime(tmphour +IDOHOZZAADAS);
}
}
}

 
remélem ez kell neked :)  :mistrust:
ha  :no: akk keresünk más megoldást
off: látom megelõztek  >:D ^-^
 
Ezt hova tegyem?

Idõ gl_realtime szerint
« Válasz #6 Dátum: 2012. Június 16. - 14:12:29 »
0 Show voters
bocsánat  :smokin:
 
mod elejére:[/quote]
 
new realtime = 1;

 

public OnGameModeInit() alá[/quote]
 
if (realtime)
{
new tmphour;
new tmpminute;
new tmpsecond;
gettime(tmphour, tmpminute, tmpsecond);
FixHour(tmphour);
tmphour = shifthour;
SetWorldTime(tmphour);
}

 

szintén oda az elözõ alá mindenképpen:[/quote]
 
SetTimer(\"RealTime\", 60000, 1);
return 1;
}

 

ezt meg vlahova a mod végére :[/quote]
 
public SyncTime()
{
new tmphour;
new tmpminute;
new tmpsecond;
gettime(tmphour, tmpminute, tmpsecond);
FixHour(tmphour);
tmphour = shifthour;
if ((tmphour > ghour) || (tmphour == 0 && ghour == 23))
{
ghour = tmphour;
if (realtime)
{
   SetWorldTime(tmphour +IDOHOZZAADAS);
}
}
}

Idõ gl_realtime szerint
« Válasz #7 Dátum: 2012. Június 17. - 12:09:19 »
0 Show voters
D:\\rpszerver\\filterscripts\\gl_realtime.pwn(87) : error 017: undefined symbol \"FixHour\"
D:\\rpszerver\\filterscripts\\gl_realtime.pwn(88) : error 017: undefined symbol \"shifthour\"
D:\\szerver\\filterscripts\\gl_realtime.pwn(124) : warning 235: public function lacks forward declaration (symbol \"SyncTime\")
D:\\szerver\\filterscripts\\gl_realtime.pwn(130) : error 017: undefined symbol \"FixHour\"
D:\\szerver\\filterscripts\\gl_realtime.pwn(131) : error 017: undefined symbol \"shifthour\"
D:\\szerver\\filterscripts\\gl_realtime.pwn(132) : error 017: undefined symbol \"ghour\"
D:\\szerver\\filterscripts\\gl_realtime.pwn(134) : error 017: undefined symbol \"ghour\"
D:\\szerver\\filterscripts\\gl_realtime.pwn(134) : warning 215: expression has no effect
D:\\szerver\\filterscripts\\gl_realtime.pwn(137) : error 017: undefined symbol \"IDOHOZZAADAS\"
Pawn compiler 3.2.3664           Copyright © 1997-2006, ITB CompuPhase
7 Errors.
 
87      FixHour(tmphour);
88 tmphour = shifthour;
124 public SyncTime()
130   FixHour(tmphour);
131   tmphour = shifthour;
132   if ((tmphour > ghour) || (tmphour == 0 && ghour == 23))
133   {
134      ghour = tmphour;
137         SetWorldTime(tmphour +IDOHOZZAADAS);

Nem elérhető JBauer

  • 1407
    • Profil megtekintése
Idõ gl_realtime szerint
« Válasz #8 Dátum: 2012. Június 17. - 12:19:04 »
0 Show voters
server.cfg-ben:
filterscripts gl_realtime
próbáltad már?

Idõ gl_realtime szerint
« Válasz #9 Dátum: 2012. Június 18. - 12:24:49 »
0 Show voters
használd a scriptet amit elöbb írtak, am forwardolni kell õket de a script egyszerübb

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal