GetGameSpeed: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
{{Server client function}}
__NOTOC__
__NOTOC__
==Description==
==Description==
This function get the current game speed value
This function gets the current game speed value.


==Syntax==
==Syntax==
Line 7: Line 8:


==Example==
==Example==
<syntaxhighlight lang="lua">addCommandHandler ( "gamespeed", "gamespeedvalue" )
This example adds a 'gamespeed' console command that prints the game speed to the chat box.
function gamespeedvalue ()
<syntaxhighlight lang="lua">
local speed = getGameSpeed ()
function gamespeedvalue ( )
outputChatbox ( "Gamespeed is currently set to " ..speed.. "" )
    local speed = getGameSpeed ( )
end</syntaxhighlight>
    outputChatbox ( "Gamespeed is currently set to " .. speed .. "." )
end
addCommandHandler ( "gamespeed", gamespeedvalue )
</syntaxhighlight>


==See Also==
==See Also==
{{World functions}}
{{World functions}}

Revision as of 19:30, 19 August 2007