Connect the Game-Clock to your PC

Started by Mötley, Mar 24, 2016, 02:34 AM

Previous topic - Next topic

Mötley

In attempts to restart the server with (onScriptUnload() || ReloadScripts());
I have attempted many Methods of When to restart the server.

I would like to use this method every 7 hours CORRECTLY.

I can freeze the game clock to your time zone and update it that way, but! it's not correct as to if no one plays the server there is no game clock method (time never changes and there is random changes in a players time change, As players have different countries/time zones..

I have been looking into http://forum.vc-mp.org/?topic=1394.0

Then curiousness hit as to can I connect the game clock to run off of my PC or  another form of a Database?
(If so the game clock will auto update allowing the scripts to Reload correctly)

This is very valuable for me to get working correctly in a professional manor. I need this function to be precise at 100% so if there is any methods to connect the game clock off of my PC at all times and or another Database form this would help me a lot

Mötley

#1
But i also noticed if i change my PC time when the server updates it update off of my time. Is this going off of the host or the players?

Sorry topic solved. Had to revert to the squirrel manual and other studies. Please judge as i may find other methods

 
to narrow it down i did something like this

minute_5 <- 0;

--------------------------------------------------------
part of my minute timer near the end i converted minute_5 >= 1
minute_5++;

if (minute_5 >= 1)
{
 
  //reload server
  if (Date["hour"] == 5 && Date["min"] == 0) (onScriptUnload() || ReloadScripts());
  else if (Date["hour"] == 12 && Date["min"] == 0) (onScriptUnload() || ReloadScripts());
  else if (Date["hour"] == 20 && Date["min"] == 0) (onScriptUnload() || ReloadScripts());
  //reload server

function onScriptLoad() {
  local Date = date();
  SetTime(Date["hour"], Date["min"]);

also
<!--HourDefault>12</HourDefault-->
<!--MinuteDefault>0</MinuteDefault-->
<!--TimeRate>1000</TimeRate-->

@S.L.C does this run off the computer of the hosting? Or when someone join's the server on the next minute It will update to there PC(I hope not)?

Standard squirrel scripting mixed with some VC:MP functions, Reads the clock from my PC and sets the time to the server then its updating every minute and checking if the time equals the ReloadScripts(check in the timer).

[Sorry your knowledgeable in your scripting to be able to simply point this out :) ]