GTA Közösség - A magyar GTA fórum

San Andreas Multiplayer (SA-MP) => SA-MP: Szerverfejlesztés => Segítségkérés => A témát indította: Devil112 - 2014. április 30. - 19:49:21

Cím: óra rendszer bug
Írta: Devil112 - 2014. április 30. - 19:49:21
Sziasztok.
Ez az óra rendszer van a szerrverbe, és beírom , hogy /óra 0, sötét lesz, majd 10-15 mp múlva újra világos..
Miért vált mindig vissza??
 

if(strcmp(cmd, \"/óra\", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
   tmp = strtok(cmdtext, idx);
   if(!strlen(tmp))
   {
      Msg(playerid,\"/óra [timeofday] (0-23)\");
      return 1;
   }
   SetWorldTime(hour);
   hour = strval(tmp);
   if (PlayerInfo[playerid][pAdmin] >= 1337)
   {
            SetWorldTime(hour);
      format(string, sizeof(string), \"   Az idõ átírva. Az új idõ:%d óra.\", hour);
      BroadCast(COLOR_GRAD1, string);
   }
   else
   {
      SendClientMessage(playerid, COLOR_GRAD1, \"   Ezt a parancsot nem használhatod !\");
   }
}
return 1;
}

 
[mod]Javítottam pawn code tagre![/mod]
Cím: óra rendszer bug
Írta: huhboy - 2014. április 30. - 19:51:01
valószínûleg van a módban egy automatikus óraátállító, ami az aktuális óra szerint állítja a szerver idejét.
Cím: óra rendszer bug
Írta: Devil112 - 2014. április 30. - 20:30:59
Hol keressem akkor??
Cím: óra rendszer bug
Írta: huhboy - 2014. április 30. - 20:34:51
Idézetet írta: Devil112 date=1398882659\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"47985\" data-ipsquote-contentclass=\"forums_Topic
Hol keressem akkor??
 
keress ilyet:
 
 SetPlayerTime(playerid, ......

 
[mod]Javítottam pawn code tagre![/mod]
Cím: óra rendszer bug
Írta: Devil112 - 2014. április 30. - 20:45:23

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,minute);
   }
   x++;
}
if(hour == 33 && minute == 00)
{
GameTextForAll(\"~w~szerver restart\",2000,1);
SetTimer(\"Gor10\", 1000, 0);
SetTimer(\"Gor9\", 2000, 0);
SetTimer(\"Gor8\", 3000, 0);
SetTimer(\"Gor7\", 4000, 0);
SetTimer(\"Gor6\", 5000, 0);
SetTimer(\"Gor5\", 6000, 0);
SetTimer(\"Gor4\", 7000, 0);
SetTimer(\"Gor3\", 8000, 0);
SetTimer(\"Gor2\", 9000, 0);
SetTimer(\"Gor1\", 10000, 0);
SetTimer(\"ServerReset\", 11000,0);
new h,mi,s,y,m,d;
getdate(y,m,d);
gettime(h,mi,s);
format(stringx,sizeof(stringx), \"[%d/%d/%d][%d:%d:%d] Hajnali 3-as frissítés.\",y,m,d,h,mi,s);
LoOoG(stringx);
}
}

 
[mod]Javítottam pawn code tagre![/mod]
Cím: óra rendszer bug
Írta: Devil112 - 2014. április 30. - 19:49:21
Sziasztok.
Ez az óra rendszer van a szerrverbe, és beírom , hogy /óra 0, sötét lesz, majd 10-15 mp múlva újra világos..
Miért vált mindig vissza??
 

if(strcmp(cmd, \"/óra\", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
   tmp = strtok(cmdtext, idx);
   if(!strlen(tmp))
   {
      Msg(playerid,\"/óra [timeofday] (0-23)\");
      return 1;
   }
   SetWorldTime(hour);
   hour = strval(tmp);
   if (PlayerInfo[playerid][pAdmin] >= 1337)
   {
            SetWorldTime(hour);
      format(string, sizeof(string), \"   Az idõ átírva. Az új idõ:%d óra.\", hour);
      BroadCast(COLOR_GRAD1, string);
   }
   else
   {
      SendClientMessage(playerid, COLOR_GRAD1, \"   Ezt a parancsot nem használhatod !\");
   }
}
return 1;
}

 
[mod]Javítottam pawn code tagre![/mod]
Cím: óra rendszer bug
Írta: huhboy - 2014. április 30. - 19:51:01
valószínûleg van a módban egy automatikus óraátállító, ami az aktuális óra szerint állítja a szerver idejét.
Cím: óra rendszer bug
Írta: Devil112 - 2014. április 30. - 20:30:59
Hol keressem akkor??
Cím: óra rendszer bug
Írta: huhboy - 2014. április 30. - 20:34:51
Idézetet írta: Devil112 date=1398882659\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"47985\" data-ipsquote-contentclass=\"forums_Topic
Hol keressem akkor??
 
keress ilyet:
 
 SetPlayerTime(playerid, ......

 
[mod]Javítottam pawn code tagre![/mod]
Cím: óra rendszer bug
Írta: Devil112 - 2014. április 30. - 20:45:23

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,minute);
   }
   x++;
}
if(hour == 33 && minute == 00)
{
GameTextForAll(\"~w~szerver restart\",2000,1);
SetTimer(\"Gor10\", 1000, 0);
SetTimer(\"Gor9\", 2000, 0);
SetTimer(\"Gor8\", 3000, 0);
SetTimer(\"Gor7\", 4000, 0);
SetTimer(\"Gor6\", 5000, 0);
SetTimer(\"Gor5\", 6000, 0);
SetTimer(\"Gor4\", 7000, 0);
SetTimer(\"Gor3\", 8000, 0);
SetTimer(\"Gor2\", 9000, 0);
SetTimer(\"Gor1\", 10000, 0);
SetTimer(\"ServerReset\", 11000,0);
new h,mi,s,y,m,d;
getdate(y,m,d);
gettime(h,mi,s);
format(stringx,sizeof(stringx), \"[%d/%d/%d][%d:%d:%d] Hajnali 3-as frissítés.\",y,m,d,h,mi,s);
LoOoG(stringx);
}
}

 
[mod]Javítottam pawn code tagre![/mod]