World time!
#1

How to set world time ? I'm from Romanian and i want Romanian Hour.
Reply
#2

If you mean how to sync it with your local time you need to get your time in-game. An example of this is using a PHP script which returns the time of a current timezone and sending it with the server syncs the time.

Example:
pawn Код:
stock syncServerTime(timezone)
{
    new string[64];
    format(string, sizeof(string), "website.com/timezone.php?t=%d", timezone);
    HTTP(0, HTTP_GET, string, "", "OnServerTimeSync");
    return 1;
}

forward OnServerTimeSync(index, response_code, data[]);
public OnServerTimeSync(index, response_code, data[])
{
    if(response_code == 200)
    {
        new timezone = strval(data);
        SetWorldTime(timezone);
    }
   
    return 1;
}
Basically, this is how something like this can be done. This would depend on a PHP script that returns the hour of your local time.
Reply
#3

Can you please what type your gamemode? and you are using PHP or something?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)