Jump to content

Vehicle .xml script


Rat32

Recommended Posts

Heelo. I have a script from vehicles XML from MTA:WIKI. But... this is not working.

AUTO.LUA:

local xml = getResourceConfig("settings.xml")      -- load XML file and get its root element 
local carmodel = xmlNodeGetAttribute(xml, "model")    -- get attribute of root element 
local carX = xmlNodeGetAttribute(xml, "posX") 
local carY = xmlNodeGetAttribute(xml, "posY") 
local carZ = xmlNodeGetAttribute(xml, "posZ") 
local carA = xmlNodeGetAttribute(xml, "rot") 
createVehicle(carmodel, tonumber(carX), tonumber(carY), tonumber(carZ), 0.0, 0.0, tonumber(carA)) 

META.XML:


SETTINGS.XML:

"Manana" posX="1803" posY="1905" posZ="13" rot="90.0" /> 

Please help :)

Link to comment
addEventHandler("onResourceStart", getRootElement(),  
    local xml = getResourceConfig("settings.xml")      -- load XML file and get its root element 
    local carmodel = xmlNodeGetAttribute(xml, "model")    -- get attribute of root element 
    local carX = xmlNodeGetAttribute(xml, "posX") 
    local carY = xmlNodeGetAttribute(xml, "posY") 
    local carZ = xmlNodeGetAttribute(xml, "posZ") 
    local carA = xmlNodeGetAttribute(xml, "rot") 
    createVehicle(carmodel, tonumber(carX), tonumber(carY), tonumber(carZ), 0.0, 0.0, tonumber(carA)) 
end 
) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...