Problem with 'Enter Car as Driver'

Status
Not open for further replies.

Expl01T3R

Active member
Joined
Nov 20, 2022
Messages
81
Reaction score
9
Location
Czech Republic
Hello UGBASE,
is there any way to force ped synced entering into car as a driver ? cuz when i call GAME API: CreateTaskComplexEnterCarAsDriver(CVehicle*) it just crash on exception inside, while creating task instance so Iam wondering if there is any other way to do it?
Thanks in advance​
 

Expl01T3R

Active member
Joined
Nov 20, 2022
Messages
81
Reaction score
9
Location
Czech Republic
Found solution by myself
//close

Solution:
C++:
const SCRIPT_COMMAND send_actor_to_car_passenger = { 0x05CA, "iiii" };
const SCRIPT_COMMAND send_actor_to_car_driverseat = { 0x05CB, "iii" };

void EnterVehicle(int iVehicleID, bool bPassenger)
{
    if (bPassenger)
    {
        ScriptCommand(&send_actor_to_car_passenger, ScriptActorId(actor_info_get(ACTOR_SELF, NULL)), iVehicleID, 3000, -1);
    }
    else
    {
        ScriptCommand(&send_actor_to_car_driverseat, ScriptActorId(actor_info_get(ACTOR_SELF, NULL)), iVehicleID, 3000);
    }
}


Call:
    EnterVehicle(g_Vehicles->pSAMP_Vehicle[targetVehicleID]->ulGTAEntityHandle, false);
 
Status
Not open for further replies.
Top