Jump to content

[solved] How can I set vehicle's data? (setElementData)


Oxsotus

Recommended Posts

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...

Link to comment
  • Moderators
[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.

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...