SetGameSpeed: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
(Undo revision 27921 by The Kid (talk))
 
(8 intermediate revisions by 6 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Server client function}}
{{Server client function}}
==Description==
This function sets the game speed to the given value.
This function sets the game speed to the given value.


==Syntax==
==Syntax==
<syntaxhighlight lang="lua">bool setGameSpeed ( int value )</syntaxhighlight>
<syntaxhighlight lang="lua">bool setGameSpeed ( float value )</syntaxhighlight>


===Required Arguments===
===Required Arguments===
*'''value''': The int value of the game speed (Range 0 - 10)
*'''value''': The float value of the game speed (Range 0 - 10)
 
===Returns===
Returns ''true'' if the gamespeed was set successfully, ''false'' otherwise.
The normal game speed is '1'.


==Example==
==Example==
Line 32: Line 35:
==See Also==
==See Also==
{{World functions}}
{{World functions}}
[[ru:setGameSpeed]]

Latest revision as of 18:43, 16 November 2011

This function sets the game speed to the given value.

Syntax

bool setGameSpeed ( float value )

Required Arguments

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

Returns

Returns true if the gamespeed was set successfully, false otherwise. The normal game speed is '1'.

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