How run the script every 15 minutes? Even if the server without players! Thanks.
Run the script every 15 minutes
-
SlimRF -
20. November 2016 um 15:21 -
Geschlossen -
Erledigt
-
-
Start it in The init.sqf with a while{true} Loop and add sleep for 15 min. (900 sec)0
-
Start it in The init.sqf with a while{true} Loop and add sleep for 15 min. (900 sec)0
init.sqf in mission/core or @life_server.pbo or mission/init.sqf
-
life_server/init.sqf
-
init.sqf in mission/core or @life_server.pbo or mission/init.sqf
life_server\init.sqf
Even if the server without players!
Deswegen würde ich sagen serverseitig @Flyyying_nflug
-
-
life_server\init.sqf
Deswegen würde ich sagen serverseitig @Flyyying_nflug
This
[] spawn
{
while {true} do
{
sleep (15 * 60);
[] call TON_fnc_updatedtime;
};
}; -
-
life_server/init.sqf
My script does not work! We need a database query?
-
Code
Alles anzeigenprivate ["_time1","_time2","_query"]; _query = format["SELECT time FROM players WHERE time='%1'",_time1]; waitUntil {sleep (random 0.3); !DB_Async_Active}; [_query,1] call DB_fnc_asyncCall; if(_time1 > 0) then { _time2 = _time1 - 1; }; _query = format["UPDATE players SET time='%1'",_time2]; waitUntil {sleep (random 0.3); !DB_Async_Active}; [_query,2] call DB_fnc_asyncCall;
What I do wrong?
-
you use a undefined variable in your query _time1
-
you use a undefined variable in your query _time1
please help me. How to write this script
PS I need to subtract 1 from all users in the database
Example: read 300 after -1 = 299 write 299 in DB