Jump to content
Sign in to follow this  
Royal_Blackwatch

Createvehicle

Recommended Posts

I´m currently making an addon in which ofp should create a second user-made addon by eventhandler and script. But Ofp does absolutely nothing. Neither I get an error message nor is the second addon created. So is it possible that createvehicle does not work with user-made addons or work in addons?

Share this post


Link to post
Share on other sites

What eventhandler are you using? Can you show us your eventhandler class? 'createVehicle' should work fine with any addon; I have used it on many occations with the F18.

Share this post


Link to post
Share on other sites

Like Penny says, it should work. Give the info he requested. smile_o.gif

Share this post


Link to post
Share on other sites

The Eventhandler is Init

and is working fine, cause I have already some other stuff in it which works 100%.

Sorry forgot to mention it above

The eventhandler calls an script named init.sqs

Heres the essential part of the script

_shippos = getpos _ship

_turr = "\BB\DTurret" createVehicle _shippos

_newdir= (getdir _ship) +180

_turr setdir _newdir

I´m not sure about the path is it

\BB\DTurret

or just DTurret

DTurret is the classname in the config

Don´t know if this is essential

the turret and the ship use the same config and pbo

Share this post


Link to post
Share on other sites

Ahh yeah, just use "DTurret" for createVehicle.

Or you can check the exact type of vehicle as it's displayed by running: player sidechat format["%1",typeof dturretOne];

Share this post


Link to post
Share on other sites

Don't use "init" event it's only server side not on clients. So in MP the turret will not create on the clients....

Use the "engine" event (or an other but engine is easier for vehic) in the "init" event with a global variable for know you are in init...

Share this post


Link to post
Share on other sites

CreateVehicle is a global command so it should work. AFAIK.

Share this post


Link to post
Share on other sites
CreateVehicle is a global command so it should work.  AFAIK.

It's true.

The init event is only server side but createvehicle creates on all client.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×