Jump to content
Sign in to follow this  
kocrachon

createvehicle spawning too many

Recommended Posts

So right now I am working on a mission where players jump out of a C-17, and when they reach a specific altitude, it deploys a shoot for them automatically and then moves them into the driver spot. I am running into an issue though.

If i run everything client side, it spawns a parachute for each client connected for each person. So if there are 4 people, that means a total of 16 parachutes end up spawning. When I move it to server side, Only one parachute spawns per person (so 4 parachutes) but the moveindriver command does not work.

Here are the two different commands I have tried.

Condition

isServer AND (getPos soldier1) select 2 <= 130 AND (getPos soldier1) select 2 >= 20

Activation

para1 = "Steerable_Parachute_F" createVehicle (position soldier1); para1 setPos [getPos soldier1 select 0, getPos soldier1 select 1, (getPos soldier1 select 2) +1]; soldier1 moveInDriver para1

And this condition with the same activation

(getPos soldier1) select 2 <= 130 AND (getPos soldier1) select 2 >= 20

Why is it if I use "isserver" the moveindriver option doesn't work? How can I make this work so that only one parachute spawns per person AND it moves them to the driver spot.

Share this post


Link to post
Share on other sites

movein* commands are local to the client. so if soldier1 isnt local to the server it won't work.

you'll want the activation to be something like

if (isServer) then {para1 = "Steerable_Parachute_F" createVehicle (position soldier1); para1 setPos [getPos soldier1 select 0, getPos soldier1 select 1, (getPos soldier1 select 2) +1]; publicvariable "para1";}; soldier1 moveInDriver para1

Don't really need it in the activation.

Share this post


Link to post
Share on other sites

How do I put that into a trigger?Dont see how I would do the soldier1 moveindriver because it runs into the exact same issue.

Share this post


Link to post
Share on other sites

Instead of using "isServer" you could simply use "local" to make sure the command is only executed on the machine where the solider is local. That should eliminate both problems.

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  

×