function getDefinitions ( startedMap )
local mapRoot = getResourceRootElement ( startedMap )
local spawnred = getElementsByType ( "spawnred", mapRoot )
local spawnblue = getElementsByType ( "spawnblue", mapRoot )
for teamr, rojos in pairs ( getPlayersInTeam ( Rojos ) ) do
local randomPoint = math.random ( #getElementsByType ( "spawnred", mapRoot ) )
local x, y, z = unpack ( getElementData ( getElementsByType ( "spawnred", mapRoot ) [ randomPoint ], "position" ) )
local rot = getElementData ( getElementsByType ( "spawnred", mapRoot ) [ randomPoint ], "rotation" )
spawnPlayer ( rojos, x, y, z, rot, 170 )
end
for teamb, azules in pairs ( getPlayersInTeam ( Blue ) ) do
local randomPoint = math.random ( #getElementsByType ( "spawnblue", mapRoot ) )
local x, y, z = unpack ( getElementData ( getElementsByType ( "spawnblue", mapRoot ) [ randomPoint ], "position" ) )
local rot = getElementData ( getElementsByType ( "spawnblue", mapRoot ) [ randomPoint ], "rotation" )
spawnPlayer ( azules, x, y, z, rot, 188 )
end
end
addEventHandler ( "onGamemodeMapStart", getRootElement(), getDefinitions )
Suponiendo que "position" sea una tabla con 3 argumentos, deberia funcionar creo yo.