Squirrel/Server/Functions/SpawnClass/Pos

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(New page: __NOTOC__ This ''SpawnClass'' class member returns or sets the spawn position for the given spawn class. == Syntax == You can either return or set a new value using this member: <code>Vec...)
 
(Example 1. Returning)
Line 13: Line 13:
 
== Example 1. Returning ==
 
== Example 1. Returning ==
  
{{Squirrel/NeedsExample}}
 
 
<code lang="squirrel">
 
<code lang="squirrel">
-- todo
+
function onPlayerCommand( player, cmd, text )
 +
{
 +
if ( cmd == "getpos" )
 +
{
 +
local pos = p_SpawnClass.Pos;
 +
MessagePlayer( "The current spawn class position is: " + pos, player );
 +
}
 +
}
 
</code>
 
</code>
  
=== Notes ===
+
This example will return the position of the spawn class, that we found earlier in [[Squirrel/Server/Functions/SpawnClass/FindSpawnClass|FindSpawnClass]].
 
+
-- Example notes/used functions here
+
  
 
== Example 2. Setting ==
 
== Example 2. Setting ==

Revision as of 17:42, 8 March 2010

This SpawnClass class member returns or sets the spawn position for the given spawn class.

Syntax

You can either return or set a new value using this member:

  1. Vector SpawnClass.Pos
  1. SpawnClass.Pos = Vector vPos

Arguments

  • vPos - This is the new spawn position for the class as a vector.

Example 1. Returning

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "getpos" )
  5. {
  6. local pos = p_SpawnClass.Pos;
  7. MessagePlayer( "The current spawn class position is: " + pos, player );
  8. }
  9. }
  10.  

This example will return the position of the spawn class, that we found earlier in FindSpawnClass.

Example 2. Setting

This function needs an example. You can help us complete the wiki by writing one, or maybe even more :o
  1.  
  2. -- todo
  3.  

Notes

-- Example notes/used functions here

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox