Log in to reply

how to make ped walking to coords

  • i tried to make my ped walking to coords that ive set , that didn't work . what should i do ? if there is any fixes pls reply

  • @avivr You spoke to them and they refused? Or you used a trainer? Or you are trying to script? Info for last 2 questions would help.

  • @JohnFromGWN Lmao , i tried to make a script

  • @avivr You can use task.goto


    Vector3 TheLocation = new Vector3(2000, 1000, 33); //make sure ped is within "brain range"
    CurrentPed.Task.RunTo(TheLocation, true, -1); //run to coords

    CurrentPed.Task.GoTo(TheLocation,-1); //walk to coords

    or this can be fun too. Here I have a binding that will make Lara walk for 5 seconds or about 1 meter from the car. Every time i hit the key, she will go back towards the car. -1 will ignore the time duration.

    Vehicle LastVehicle = Function.Call<Vehicle>(Hash.GET_VEHICLE_PED_IS_IN, Game.Player.Character, true);
    Function.Call(Hash.TASK_GO_TO_ENTITY, CurrentPed, LastVehicle, 5000, 1.0, 100, 1073741824, 0);

  • Tnx , you maybe know how to detect a ped if the ped get aimed by a player ? and also how to make ped get in car
    but with animation because every time im trying to do something it teleport

  • @JohnFromGWN i know , i did this : public void EnterVehicle(Vehicle vehicle, VehicleSeat seat, int timeout, float speed, int flag)
    Function.Call(Hash.TASK_ENTER_VEHICLE, _ped.Handle, vehicle.Handle, timeout, (int)(seat), speed, flag, 0);
    and for somereason it teleoprt the ped to the vehicle and not walk then get in

  • @avivr PedPlayer.Task.EnterVehicle(Vehicle1, VehicleSeat.Driver, -1, 0.0F, 0)

  • @avivr When using native functions, the ones that have documentation, you need to review the parameters.

    In your case, p5 (they start at 0) will teleport if set to 3. Should be set to 1.


    void TASK_ENTER_VEHICLE(Ped ped, Vehicle vehicle, int timeout, int seat, float speed, int flag, Any p6) // 0xC20E50AA46D09CA8 0xB8689B4E b323

    speed 1.0 = walk, 2.0 = run
    p5 1 = normal, 3 = teleport to vehicle, 16 = teleport directly into vehicle
    p6 is always 0

    Usage of seat
    -1 = driver
    0 = passenger
    1 = left back seat
    2 = right back seat
    3 = outside left
    4 = outside right

  • These are the flags for TASK_ENTER_VEHICLE: https://github.com/crosire/scripthookvdotnet/blob/main/source/scripting_v3/GTA/Entities/Peds/EnterVehicleFlags.cs

    Flag 1 isn't in that enum, for unknown reasons. Flag 3 is flag 2 + flag 1.

  • @Jitnaught thanks for the update, i use SHVDN3 and didn't realize the natives had been updated and ofc the .db is no longer updated.

  • @avivr So you can use either the native function or the SHVDN one. From VS, you can view the enums by hitting F12.

    alt text

  • @JohnFromGWN how do i add it or use it ?

  • @avivr i don't know what you mean. You use it as per the examples above.

    PedPlayer.Task.EnterVehicle(Vehicle1, VehicleSeat.Driver, -1, 0.0F, 0)

  • @avivr You can also have the ped spawn directly in a car or on a motorcycle. This is practical if you want to spawn 30 or 40 peds and have them race, as in the video.

    Vehicle vehiclePP = World.CreateVehicle("softail1", PP.Position + PP.ForwardVector * 1.0f, PP.Heading + 90);

    Vehicle vehicle1 = World.CreateVehicle("117", PP.Position + PP.ForwardVector * 3.0f, PP.Heading + 90);
    Ped Vagos = vehicle1.CreatePedOnSeat(VehicleSeat.Driver, PedHash.Vagos01GFY);

Log in to reply

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.