Squirrel/Server/Functions/Game/SetSurfaceTraction

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(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 ==
  
{{Squirrel/NeedsExample}}
+
This will set the rubber/rubber surface to a traction level of 1.00 when the player types '/surfacetraction'
Explanation for the example
+
  
 
<code lang="squirrel">
 
<code lang="squirrel">
-- Todo
+
function onPlayerCommand( pPlayer, szCommand, szText )
 +
{
 +
if ( szCommand == "surfacetraction" )
 +
{
 +
SetSurfaceTraction( SURFACE_RUBBER_RUBBER, 1.00 );
 +
}
 +
 +
return 1;
 +
}
 
</code>
 
</code>
  
 
=== Notes ===
 
=== Notes ===
  
-- List of used functions and other notes here.  
+
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

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This sets the traction of the specified surface

[edit] Syntax

  1. 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'

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "surfacetraction" )
  5. {
  6. SetSurfaceTraction( SURFACE_RUBBER_RUBBER, 1.00 );
  7. }
  8. return 1;
  9. }
  10.  

[edit] Notes

The event onPlayerCommand was used in this example. More info about this in the corresponding page.

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox