Forum Jump :

Author Message

Posts: 3

Level: Member

Country: ma
In-game name:

#1 Posted at 2018-07-07 09:39        
So i'm trying to make a simple script to force a player into nearest vehicle for an MP mission
Player x is a cop
Player y is a suspect
Using a dialog when cop presse Put in vehicle while looking at player y a script puntinvehicle.sqf fires
This is what i have so far
_newCiv = cursorTarget; //Player to force in vehicle
_vcl = nearestObjects [player, ["LandVehicle","Air"], 10]; //detects any vehicle around the player forcing _newCiv into a vehicle
_dst = distance player _newCiv; // distance have to be 5 meters or less between both players

if (_dst <=5 and _newCiv isKindOf "man") then
  _newCiv moveInCargo [_vcl,2];
ps: im trying the script on an AI i'm unable to have a test on a dedicated with a player at the moment.