Oxsotus Posted July 16, 2013 Posted July 16, 2013 Hi! I wrote this, but I have 2 problems. First: This is the vehicle spawn. It's write an error: [2013-07-16 10:44:07] WARNING: rpg\main_jobs\radio\radio_kocsik.lua:34: Bad argument @ 'setElementData' [Expected element at argument 1, got boolean] [2013-07-16 10:44:07] WARNING: rpg\main_jobs\radio\radio_kocsik.lua:35: Bad argument @ 'setElementData' [Expected element at argument 1, got boolean] function radio_kocsik_spawnolasa() local x1,y1,z1 = 1201.80005,256,19.7 local x2,y2,z2 = 1199.30005,248.60001,19.7 radios1 = createVehicle ( 582, x1, y1, z1, 0, 0, 0, "RC-N-01", false, 10, 1) radios2 = createVehicle ( 582, x2, y2, z2, 0, 0, 0, "RC-N-02", false, 10, 1) local r_munka_id = 5 setElementData(radios1,"f_munka",r_munka_id) setElementData(radios2,"f_munka",r_munka_id) end addEventHandler ( "onResourceStart", getRootElement(),radio_kocsik_spawnolasa ) How can I set vehicle element data? The createVehicle is bad? Second problem: I deleted the setElementData... rows, to start the script, and it doesn't spawn the vehicles. ------------------------------ I foul the create vehicle... the good: radios1 = createVehicle ( 582, x1, y1, z1, 0, 0, 0, "RC-N-01") radios2 = createVehicle ( 582, x2, y2, z2, 0, 0, 0, "RC-N-02") I thinked the variant1 and varient2 is the color...
Moderators IIYAMA Posted July 16, 2013 Moderators Posted July 16, 2013 [2013-07-16 10:44:07] WARNING: rpg\main_jobs\radio\radio_kocsik.lua:34: Bad argument @ 'setElementData' [Expected element at argument 1, got boolean] It looks like your vehicles don't get created successfully.* *ah you already said that. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now