Squirrel/Server/Functions/Game/SetSurfaceTraction
From Liberty Unleashed Wiki
(Difference between revisions)
(Created page with '{{Squirrel/Title|SetSurfaceTraction}} This sets the traction of the specified surface == Syntax == <code>float SetSurfaceTraction( int surface, float value )</code> == Argumen…') |
|||
Line 13: | Line 13: | ||
== Example == | == Example == | ||
− | + | This will set the rubber/rubber surface to a traction level of 1.00 when the player types '/surfacetraction' | |
− | + | ||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | + | function onPlayerCommand( pPlayer, szCommand, szText ) | |
+ | { | ||
+ | if ( szCommand == "surfacetraction" ) | ||
+ | { | ||
+ | SetSurfaceTraction( SURFACE_RUBBER_RUBBER, 1.00 ); | ||
+ | } | ||
+ | |||
+ | return 1; | ||
+ | } | ||
</code> | </code> | ||
=== Notes === | === Notes === | ||
− | + | The event [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] was used in this example. More info about this in the corresponding page. | |
== Related Functions == | == Related Functions == | ||
{{Squirrel/Server/Functions/Game}} | {{Squirrel/Server/Functions/Game}} |
Latest revision as of 23:48, 19 October 2010
This sets the traction of the specified surface
[edit] Syntax
float SetSurfaceTraction( int surface, float value )
[edit] Arguments
- surface - The surface to query. As defined Here
- value - The value to set the surface traction to
[edit] Example
This will set the rubber/rubber surface to a traction level of 1.00 when the player types '/surfacetraction'
function onPlayerCommand( pPlayer, szCommand, szText ) { if ( szCommand == "surfacetraction" ) { SetSurfaceTraction( SURFACE_RUBBER_RUBBER, 1.00 ); } return 1; }
[edit] Notes
The event onPlayerCommand was used in this example. More info about this in the corresponding page.
[edit] Related Functions
- CloseGarage
- CloseSSVBridge
- EnableTrains
- GetBoundariesLower
- GetBoundariesUpper
- GetFriendlyFire
- GetGamespeed
- GetGravity
- GetHour
- GetIslands
- GetMinute
- GetSSVBridgeLock
- GetSSVBridgeUpdateTime
- GetSurfaceTraction
- GetTimeLock
- GetWeather
- GetWeatherLock
- IsSSVBridgeUp
- OpenGarage
- OpenSSVBridge
- SetBoundaries
- SetFriendlyFire
- SetGamespeed
- SetGravity
- SetIslands
- SetSSVBridgeLock
- SetSSVBridgeUpdateTime
- SetSurfaceTraction
- SetTime
- SetTimeLock
- SetWeather
- SetWeatherLock