The online racing simulator
[Solved] Save players data every 6 seconds
I am trying to figure out how to add a Autosave feature that saves every 6000ms and I do not want it to show: "Server saved" every 6000ms. Is there a way?
You could create a timer that would tick every 6000ms and then saves whatever you want.
You could use the next option ( just an example)

Event OnLapperStart()
#Syntax: ss mm hh dayofweek dd MM YYYY
RegisterScheduleAction( "0 * * * * * *", Timer_Sub ); #Timer each minute
EndEvent

Sub Timer_Sub()
$Players = GetListOfPlayers(); #Get list of all players in the server
FOREACH ($User IN $Players) #Check each player one by one.
setUserStoredValue($User["value"], "Cash", GetPlayerVar($User["value"],"Cash")); #Store Cash to database
ENDFOREACH
EndSub

This thread is closed

FGED GREDG RDFGDR GSFDG