Jump to content
Sign in to follow this  
solentis

Vehicle do not spawn correctly in MP

Recommended Posts

Hi,

trying to spawn and move some hostile vehicle, I fail badly. One instance of vehicle spawn at the same place for each present player, and explode.

Here is my code:

_Mech1 = [(getmarkerPos "Mech1"), 316, "B_G_Offroad_01_armed_F", east] call BIS_fnc_spawnVehicle;
_group_Mech1  = _Mech1  select 2;
_wp = _group_Mech1  addWaypoint [getMarkerPos "AmbushMech1", 0];

_wp setWaypointBehaviour "COMBAT";
_wp setWaypointCombatMode "RED";
_wp setWaypointCompletionRadius 0;
_wp setWaypointFormation "WEDGE";
_wp setWaypointSpeed "NORMAL";
_wp setwaypointType "MOVE";  

Share this post


Link to post
Share on other sites
try adding a if (!isServer) exitWith {}; at the start.

or just run it from initServer.sqf ...

Share this post


Link to post
Share on other sites
Hi,

trying to spawn and move some hostile vehicle, I fail badly. One instance of vehicle spawn at the same place for each present player, and explode.

Here is my code:

_Mech1 = [(getmarkerPos "Mech1"), 316, "B_G_Offroad_01_armed_F", east] call BIS_fnc_spawnVehicle;
_group_Mech1  = _Mech1  select 2;
_wp = _group_Mech1  addWaypoint [getMarkerPos "AmbushMech1", 0];

_wp setWaypointBehaviour "COMBAT";
_wp setWaypointCombatMode "RED";
_wp setWaypointCompletionRadius 0;
_wp setWaypointFormation "WEDGE";
_wp setWaypointSpeed "NORMAL";
_wp setwaypointType "MOVE";  

Quick tip for you gents... When posting code, prefix your code with OpenSquareBracket php CloseSquareBracket and end with OpenSquareBracket /php CloseSquareBracket

In other words, replace the word code with php

Like this...

if (!isServer) exitWith {};
_Mech1 = [(getmarkerPos "Mech1"), 316, "B_G_Offroad_01_armed_F", east] call BIS_fnc_spawnVehicle;
_group_Mech1  = _Mech1  select 2;
_wp = _group_Mech1  addWaypoint [getMarkerPos "AmbushMech1", 0];

_wp setWaypointBehaviour "COMBAT";
_wp setWaypointCombatMode "RED";
_wp setWaypointCompletionRadius 0;
_wp setWaypointFormation "WEDGE";
_wp setWaypointSpeed "NORMAL";
_wp setwaypointType "MOVE";  

]

Edited by Beerkan

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  

×