ScriptingExamples/BasicTimer: Difference between revisions

From GTA Connected
Jump to navigation Jump to search
No edit summary
 
(No difference)

Latest revision as of 18:06, 5 February 2019

Description

This code adds a message to the chat box every 5 minutes.

Code

JavaScript, Server-Side:

setInterval(function()
{
	message('This message is shown every five minutes!');
}, 5 * 60 * 1000);

Notes

The code uses setInterval, which is a shared function, shared means that the functionality is available both server-side and client-side.