Squirrel/Server/Functions/Players/SetBoundaries

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with '{{Squirrel/Title|Player.SetBoundaries}} This function sets the players boundaries. == Syntax == <code>bool player.SetBoundaries( Vector lowerBounds, Vector upperBounds )</code>…')
 
 
Line 13: Line 13:
 
== Example ==
 
== Example ==
  
{{Squirrel/NeedsExample}}
+
This example command sets the players world boundaries to (-1000, -1000, -1000), (1000, 1000, 1000).
Explanation for the example
+
  
 
<code lang="squirrel">
 
<code lang="squirrel">
-- todo
+
function onPlayerCommand( pPlayer, szCommand, szText )
 +
{
 +
if ( szCommand == "setboundaries" )
 +
{
 +
local up = Vector( -1000.00, -1000.00, 1000.00 ), lower = Vector( -1000.00, -1000.00, -1000.00 );
 +
pPlayer.SetBoundaries( up, lower );
 +
}
 +
 +
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/Players}}
 
{{Squirrel/Server/Functions/Players}}

Latest revision as of 16:11, 25 October 2010

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

This function sets the players boundaries.

[edit] Syntax

  1. bool player.SetBoundaries( Vector lowerBounds, Vector upperBounds )

[edit] Arguments

  • lowerBounds - The lower boundaries
  • upperBounds - The upper boundaries

[edit] Example

This example command sets the players world boundaries to (-1000, -1000, -1000), (1000, 1000, 1000).

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "setboundaries" )
  5. {
  6. local up = Vector( -1000.00, -1000.00, 1000.00 ), lower = Vector( -1000.00, -1000.00, -1000.00 );
  7. pPlayer.SetBoundaries( up, lower );
  8. }
  9. return 1;
  10. }
  11.  

[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