SpawnClass.Pos
From Liberty Unleashed Wiki
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.
function onPlayerCommand( player, cmd, text ) { if ( cmd == "setpos" ) { local pos = player.Pos, newpos = Vector( pos.x, pos.y, pos.z ); p_SpawnClass.Pos = newpos; } }
This example will set the position of the spawn class, that we found earlier in FindSpawnClass, to the players current position.
Notes
The call onPlayerCommand was used in in this example. More info about this in the corresponding page.