Resource:Spawnmanager/getSpawnpointRotation: Difference between revisions
Jump to navigation
Jump to search
(New page: __NOTOC__ {{Server function}} This function returns the current rotation of the specified spawnpoint. ==Syntax== <syntaxhighlight lang="lua"> float getSpawnpointRotation ( spawnpoint theSpawn ) ...) |
No edit summary |
||
Line 35: | Line 35: | ||
addEventHandler ( "onPlayerSpawn", getRootElement(), checkPlayerSpawn ) | addEventHandler ( "onPlayerSpawn", getRootElement(), checkPlayerSpawn ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 19:30, 19 October 2007
This function returns the current rotation of the specified spawnpoint.
Syntax
float getSpawnpointRotation ( spawnpoint theSpawn )
Required Arguments
- theSpawn: The spawnpoint element to get rotation of.
Returns
Returns the rotation as a float if the spawnpoint is valid, false otherwise.
Example
This example outputs the rotation associated with a spawnpoint when a player spawns.
function checkPlayerSpawn ( theSpawnpoint ) local outString = "Player spawned" local spawnRotation if ( theSpawnpoint ) then outString = outString .. " on a spawnpoint" spawnRotation = call(getResourceFromName("spawnmanager", "getSpawnpointRotation", theSpawnpoint ) if ( spawnRotation ) then outString = outString .. " with rotation: " .. tostring(spawnRotation) end end outString = outString .. "." outputChatBox ( outString ) end addEventHandler ( "onPlayerSpawn", getRootElement(), checkPlayerSpawn )