Jump to content

[Solved] Problems with Vehicle DriveToPosition


LowRid3R

Recommended Posts

Hi all..

 

i´m facing some serious problems within my callouts.

I spawn 2 additional units somewhere on the map... mostly far away from the callout scene.

When i set the parameter for letting them drive to a specific vector 3 they just don´t drive. When i teleport myself to their spawnpoint, then they start driving to the correct vector3...

I tried with following lines:

//THIS
_ped_cop_help01.Tasks.DriveToPosition(_veh_cop_help01, _areas[1]._wait_position, 20, VehicleDrivingFlags.Emergency, 2f);
//OR
NativeFunction.CallByName<uint>("TASK_VEHICLE_DRIVE_TO_COORD", _ped_cop_help01, _veh_cop_help01, _areas[1]._wait_position.X, _areas[1]._wait_position.Y, _areas[1]._wait_position.Z , 20f, 1, _veh_cop_help01.Model.Hash, 1074528293, 2f, -1);

i have absolutely no clue where the problem is... on both lines the do the same...

Ped and Vehicle is spawned on OnCallAccepted with:

_veh_cop_help01 = new Vehicle(_cops[0]._backup_veh_model, _cops[0]._backup_position, _cops[0]._backup_heading);
_veh_cop_help01.IsPersistent = true;
_veh_cop_help01.IsEngineOn = true;
_veh_cop_help01.IsVisible = true;

_ped_cop_help01 = new Ped(_cops[0]._backup_ped_model, _veh_cop_help01.Position, 0f);
_ped_cop_help01.IsPersistent = true;
_ped_cop_help01.IsVisible = true;
_ped_cop_help01.WarpIntoVehicle(_veh_cop_help01, -1);

BR

Edited by LowRid3R
Link to comment
Share on other sites

alex, you saved my ass :)..

 

you were right with the longrange stuff.. but there was a additional twist...

Before i run that command i needed to be sure that all properties of the vehicle and ped are written.. therefore a simple GameFiber.Wait(2000) solved everything else...

 

thx, i owe you one

Link to comment
Share on other sites

You can also call for backup directly with Functions.RequestBackup and send them to a desired location. 

[REL] Coastal Callouts: An action-packed mod with new vehicles, maps, capabilities, and callouts in and around the waters of Los Santos

[REL] Police Tape: Make your scenes more realistic while stopping peds and traffic

[REL] Better EMS: Realistic and dynamic EMS response

Join the Parks Benefactor Program to support my work and get early beta access!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...