Jump to content
Sign in to follow this  
coderedfox

Createvehicle (server) then adding addaction for all players

Recommended Posts

Hello,

I've been racking my brain on this one being new to arma scripting. Here is my situation

I have two scripts running

createvehicle.sqf - (Server side only)

This creates a vehicle and preforms a taxi duty. So if its destroyed it respawns and continues its duty. This script adds a addaction "Flight Plan" which calls flightplan.sqf only added when the taxi is on the runway. Also removed the command once the vehicle is in motion.

flightplan.sqf - (Client side only)

When a player nears the taxi (or is in the taxi) the player (any multiplayer) calls this script when clicking on the addaction started from the createvehicle.sqf. This will sets a marker for the (createvehicle.sqf) vehicle to go to.

Now I have tried VarName, publicVariable, and other ways to allow clients to see a server based createvehicle. Yet the clients can never get any data from the server called vehicle. I've called the vehicle (_vehicle,vehicle, MH60STaxi,"MH60STaxi") and non of these get passed to clients. Which the biki explains as well.

Some help would be appreciated.

Edited by CodeRedFox
updated

Share this post


Link to post
Share on other sites

Use createVehicle_array when creating vehicles on the server. It will be local to the server, But everyone will see it.

If your having further problems post up what you have and we can probably help you a lot better.

Share this post


Link to post
Share on other sites

this is what i use, its nothing so complicated as what your looking for but

if(not isServer) exitWith{};
_device = "Object Name" createVehicle [position x, position y, position z];
_device setVehicleInit "this addAction [""Select Action"",""script.sqf""];"; processInitCommands;

whoever selects the option initilises the script on their client.

not sure but i hope that helps

Edited by roy86

Share this post


Link to post
Share on other sites

As Riouken said, use createVehicle array, the one you use has no good handler, even though you think so.

_veh = createVehicle ["heli_class_name",getMarkerPos "marker1",[], 0, "NONE"];

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  

×