Weather fast change instead of slowly changing
#1

Hi, my problem is weather. It changes too fast every three hours.
When iam using
PHP код:
public OnPlayerConnect(playerid)
{
    
TogglePlayerClock(playerid1); // Show the clock (i don't want to show the clock because i already made the clock textdraw.
..................other codes 
time goes fast, like too fast. I don't know how to fix this bug.

But if i put toggleplayerclock to 0 then time goes normal and weather changes fast. When weather changes slowly, then clock goes too fast (15 seconds goes all day) instead of 24min 1 gameday

What to do?
Reply
#2

Just disable the player clock and use SetPlayerTime
Reply
#3

Quote:
Originally Posted by ShihabSoft
Посмотреть сообщение
Just disable the player clock and use SetPlayerTime
I tried, but it says:
PHP код:
gamemodes\cnr.pwn(3237) : error 021symbol already defined"SetPlayerTime" 
I've tried in script CTRL+F to find it if its already definied and couldn't find it except my added SetPlayerTime. Do you know maybe where do i have to put this?

PHP код:
SetPlayerTime(playerid00); // Midnight 
Reply
#4

Quote:
Originally Posted by DarknesS1988
Посмотреть сообщение
PHP код:
SetPlayerTime(playerid00); // Midnight 
OnPlayerConnect.

Also i suggest you to look at gl_realtime filterscript, which can be found downloading 0.3.7/0.3DL server package.

Or here:

https://github.com/Southclaws/samp-H...l_realtime.pwn

Which also has weather support.
Reply
#5

Quote:
Originally Posted by KinderClans
Посмотреть сообщение
OnPlayerConnect.

Also i suggest you to look at gl_realtime filterscript, which can be found downloading 0.3.7/0.3DL server package.

Or here:

https://github.com/Southclaws/samp-H...l_realtime.pwn

Which also has weather support.
I have 1 good news and 1 bad news!
Good news: Weather is changing slowly now, next problem is...
Here, look it:
When player joins the server it's automaticly started from 00:00 even if it's server time example 10:10

See the pics below:




I have:
PHP код:
public OnPlayerConnect(playerid)
{
    
SetWorldTime(0);
    
SetPlayerTime(playerid00); // Midnight
    
TogglePlayerClock(playerid1); // Show the clock 
I need somehow sync players time with the server.
Tried to search the samp wiki but i just don't get it. Can someone explain to me what to do next pls?
Reply
#6

Try this

new gHour, gWorldTime;

gettime(.hour = gHour);
gettime(.hour = gWorldTime);
SetWorldTime(gWorldTime);

Put the above in OnGameModeInit
Reply
#7

Quote:
Originally Posted by ShihabSoft
Посмотреть сообщение
Try this

new gHour, gWorldTime;

gettime(.hour = gHour);
gettime(.hour = gWorldTime);
SetWorldTime(gWorldTime);

Put the above in OnGameModeInit
Still the same like before this code. When i join time start counting (1sec = 1game min, so 10min=10 game hours)
then i quit and rejoin, clock starts from 00:00 then goes. Something is not synched with all.
Reply
#8

Actually, what's the issue now?

Do you mean, that Game time is not synced with the clock time?
Reply
#9

Quote:
Originally Posted by ShihabSoft
Посмотреть сообщение
Try this

new gHour, gWorldTime;

gettime(.hour = gHour);
gettime(.hour = gWorldTime);
SetWorldTime(gWorldTime);

Put the above in OnGameModeInit
pawn Код:
gettime(hour, minute);
   
    new string[60];
    format(string,sizeof string, "* Game Time: %02d:%02d",hour,minute);
    SendClientMessage(playerid, -1, string);
Tried on player connect and it works. Time is syncronized.
Reply
#10

Quote:
Originally Posted by KinderClans
Посмотреть сообщение
pawn Код:
gettime(hour, minute);
   
    new string[60];
    format(string,sizeof string, "* Game Time: %02d:%02d",hour,minute);
    SendClientMessage(playerid, -1, string);
Tried on player connect and it works. Time is syncronized.
I've got this, what i did wrong?
PHP код:
...\cnr.pwn(9919) : error 017undefined symbol "hour"
...\cnr.pwn(9922) : error 017undefined symbol "hour"
...\cnr.pwn(9926) : error 021symbol already defined"string"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
3 Errors

Here is my code, maybe i have messed something:

PHP код:
public OnPlayerConnect(playerid)
{
    new 
gHourgWorldTime;
gettime(.hour gHour);
gettime(.hour gWorldTime);
SetWorldTime(gWorldTime);
gettime(hourminute);
    new 
string[60];
       
format(string,sizeof string"* Game Time: %02d:%02d",hour,minute);
       
SendClientMessage(playerid, -1string);
    
TogglePlayerClock(playerid1); // Show the clock
    
    
new string[256],Query[200];
    
GetPlayerName(playeridPlayerInfo[playerid][pName], 128);
    
GetPlayerIp(playeridPlayerInfo[playerid][pIP], 50);
    
ResetAllPlayerStats(playerid);
    
    
SetPlayerColor(playeridCOLOR_DEAD);
       if (
IsPlayerNPC(playerid))
    {
    
/*new ip_addr_npc[64+1];
    new ip_addr_server[64+1];
    GetServerVarAsString("bind",ip_addr_server,64);
    GetPlayerIp(playerid,ip_addr_npc,64);
    if(!strlen(ip_addr_server)) {
     ip_addr_server = "127.0.0.1";
    }
    if(strcmp(ip_addr_npc,ip_addr_server,true) != 0) {
     // this bot is remote connecting
      printf("NPC: Remote NPC Attempting To Connect From %s And I'm Kicking It.",ip_addr_npc);
      Kick(playerid);
      return 0;......
..............................
........................and so on continues 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)