SetGameSpeed: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Confirmed to work client-side)
No edit summary
Line 11: Line 11:


==Example==
==Example==
<section name="Server" class="server" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function gamespeedfunction ( sourcePlayer, command, value )
addCommandHandler("setgamespeed",
      setGameSpeed ( tonumber ( value ) )
  function(sourcePlayer, command, value)
end
    setGameSpeed(tonumber(value))
addCommandHandler ( "setgamespeed", gamespeedfunction )
  end
)
</syntaxhighlight>
</syntaxhighlight>
</section>
<section name="Client" class="client" show="true">
<syntaxhighlight lang="lua">
addCommandHandler("setgamespeed",
  function(command, value)
    setGameSpeed(tonumber(value))
  end
)
</syntaxhighlight>
</section>


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

Revision as of 11:54, 14 May 2009

Description

This function sets the game speed to the given value.

Syntax

setGameSpeed ( int value )

Required Arguments

  • value: The int value of the game speed (Range 0 - 10)

Example

Click to collapse [-]
Server
addCommandHandler("setgamespeed",
  function(sourcePlayer, command, value)
    setGameSpeed(tonumber(value))
  end
)
Click to collapse [-]
Client
addCommandHandler("setgamespeed",
  function(command, value)
    setGameSpeed(tonumber(value))
  end
)

See Also