Yeah but I meant specifically for that file
Would it just be:
<meta>
<info author="Evildropbear" version="1" name="script" description="Loads co-ordinates from map" type="script"/>
<script src="script.lua" type="server"/>
</meta>
If I use that, and then type in the console 'gamemode myserver mymap' nothing happens
Since the files are practically copied straight out of the wiki, I can't really see what might be wrong with them, but I'll post them anyway.
mymap.map
<map>
<spawnpoint id="spawnpoint1" posX="-1986.1390" posY="-1282.9088" posZ="23.9697" rot="63.350006103516" model="0"/>
</map
script.lua
function loadMap(startedMap)
mapRoot = getResourceRootElement(startedMap)
end
addEventHandler("onGamemodeMapStart", getRootElement(), loadMap)
function joinHandler()
local spawn = getElementsByType("spawnpoint", mapRoot)
local x,y,z,r
for key, value in pairs(spawn) do
x = getElementData(value, "posX")
y = getElementData(value, "posY")
z = getElementData(value, "posZ")
r = getElementData(value, "rot")
end
spawnPlayer(source, x, y, z)
fadeCamera(source, true)
end