I managed to confuse myself - Custom game time help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: I managed to confuse myself - Custom game time help (
/showthread.php?tid=516870)
I managed to confuse myself - Custom game time help -
Aerotactics - 02.06.2014
Brief: If the time is afternoon (pm), the world time should not look like midnight, however it does. I thought I was pro at counting and conditionals. lol
pawn Код:
// Update time
minute++;
if(minute == 60)
{
minute = 0;
hour++;
}
if(hour == 12 && minute == 0)
{
if(IsMorning == true){IsMorning = false;}
else{IsMorning = true;}
}
if(hour == 13){hour = 1;}
new gamehour;
if((IsMorning == false && hour != 12) || (IsMorning == true && hour == 12))
{
gamehour = hour+12;
}
else {gamehour = hour;}
SetWorldTime(gamehour);
Re: I managed to confuse myself - Custom game time help -
Rittik - 02.06.2014
Use gl_realtime.pwn it's already in your "filterscripts" folder.
Re: I managed to confuse myself - Custom game time help -
Aerotactics - 02.06.2014
Quote:
Originally Posted by Rittik
Use gl_realtime.pwn it's already in your "filterscripts" folder.
|
This is modified from gl_realtime, I am looking for help with the script at hand.
Re: I managed to confuse myself - Custom game time help -
AiRaLoKa - 02.06.2014
pawn Код:
//
minute++;
if(minute == 60)
{
minute = 0;
hour++;
gamehour++;//define it with the minute thingy
}
if(hour == 12 && minute == 0)
{
if(IsMorning == true){IsMorning = false;}
else{IsMorning = true;}
}
if(hour == 13){hour = 1;}
if(gamehour > 23){gamehour = 0;}
SetWorldTime(gamehour);
i don't know is it work or not...
but hope it's worked
Re: I managed to confuse myself - Custom game time help -
Aerotactics - 02.06.2014
Quote:
Originally Posted by AiRaLoKa
pawn Код:
// minute++; gamehour++;//define it with the minute thingy if(minute == 60) { minute = 0; hour++; gamehour++; } if(hour == 12 && minute == 0) { if(IsMorning == true){IsMorning = false;} else{IsMorning = true;} } if(hour == 13){hour = 1;} if(gamehour==24){gamehour=0;} SetWorldTime(gamehour);
i don't know is it work or not...
but hope it's worked
|
I'll be trying ti, thanks. I thought this might work just by reading it, we'll see.
EDIT: (facepalm) hours are 0-23, rather than 1-24. Thanks for the help anyways lol
Re: I managed to confuse myself - Custom game time help -
AiRaLoKa - 03.06.2014
you can also do this (just remembering)
pawn Код:
//
minute++;
if(minute == 60)
{
minute = 0;
hour++;
gamehour++;//define it with the minute thingy
}
if(hour == 12 && minute == 0)
{
if(IsMorning == true){IsMorning = false;}
else{IsMorning = true;}
}
if(hour == 13){hour = 1;}
if(gamehour > 23){gamehour = 0;}
SetWorldTime(gamehour, minute);// for detailed maybe