Squirrel/Server/Functions/SpawnClass/Pos
From Liberty Unleashed Wiki
(Difference between revisions)
(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 == | ||
− | |||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | + | function onPlayerCommand( player, cmd, text ) | |
+ | { | ||
+ | if ( cmd == "getpos" ) | ||
+ | { | ||
+ | local pos = p_SpawnClass.Pos; | ||
+ | MessagePlayer( "The current spawn class position is: " + pos, player ); | ||
+ | } | ||
+ | } | ||
</code> | </code> | ||
− | + | This example will return the position of the spawn class, that we found earlier in [[Squirrel/Server/Functions/SpawnClass/FindSpawnClass|FindSpawnClass]]. | |
− | + | ||
− | + | ||
== 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:
Vector SpawnClass.Pos
SpawnClass.Pos = Vector vPos
Arguments
- vPos - This is the new spawn position for the class as a vector.
Example 1. Returning
function onPlayerCommand( player, cmd, text ) { if ( cmd == "getpos" ) { local pos = p_SpawnClass.Pos; MessagePlayer( "The current spawn class position is: " + pos, player ); } }
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
-- todo
Notes
-- Example notes/used functions here