I have a little problem with the Freeroam resource.
I've created a little teleport menu inside the freeroam resource, copied the interior part, it's ''almost'' the same with what I need.
I've also added a new .xml with all the locations.
But when I start the resource, it says: "locations.xml could not be opened."
Idk what the problems are. >.>
function setLocation(leaf)
server.setElementInterior(g_Me, leaf.world)
local vehicle = getPedOccupiedVehicle(g_Me)
if vehicle then
server.setElementInterior(vehicle, leaf.world)
for i=0,getVehicleMaxPassengers(vehicle) do
local player = getVehicleOccupant(vehicle, i)
if player and player ~= g_Me then
server.setElementInterior(player, leaf.world)
server.setCameraInterior(player, leaf.world)
end
end
end
setCameraInterior(leaf.world)
setPlayerPosition(leaf.posX, leaf.posY, leaf.posZ + 1)
closeWindow(wndSetLocation)
end
wndSetLocation = {
'wnd',
text = 'Set location',
width = 250,
controls = {
{
'lst',
id='locations',
width=230,
height=300,
columns={
{text='Location', attr='name'}
},
rows={xml='locations.xml', attrs={'name', 'posX', 'posY', 'posZ', 'world'}},
onitemdoubleclick=setLocation
},
{'btn', id='close', closeswindow=true}
}
}
The locations.xml is something like this:
<catalog type="location">
<location name="Test" posX="-1499.2492675781" posY"-214.14785766602" posZ"14.383546829224" world="0"/>
</catalog>
I'm a beginner, so don't laugh.
Grtz, Jockie. (^.^)-b