I managed to confuse myself - Custom game time help
#1

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);
Reply
#2

Use gl_realtime.pwn it's already in your "filterscripts" folder.
Reply
#3

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.
Reply
#4

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
Reply
#5

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
Reply
#6

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)