Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

Sign in to follow this  
marhex

[.net] races mod

Recommended Posts

marhex

i am trying to make a race mod but i can't make them race

this is my cod

 

racer01Task = new TaskSequence();
racer01Task.AddTask.WarpIntoVehicle(veh_racer1, VehicleSeat.Driver);
for (int i = 0; i < number_ch;i++ )
{
racer01Task.AddTask.DriveTo(veh_racer1, chackpoints, 15f, 550f, (int)DrivingStyle.Rushed);
}

racer01Task.Close();

 

racer1.Task.PerformSequence(racer01Task);

 

can anyone help me please to make them race like in the game.

Share this post


Link to post
Share on other sites
Mgel

From what you've provided, the only thing i would see as a problem is the speed of the vehicle.

I believe that 550f is way to much, i would recommend doing this instead

Hash veh_racer1_hash = veh_racer1.GetHashCode();float veh_racer1_max = Function.Call<float>GET_VEHICLE_MAX_SPEED(veh_racer1_hash)racer01Task.AddTask.DriveTo(veh_racer1, chackpoints[i], 15f, veh_racer1_max, (int)DrivingStyle.Rushed);
Edited by Mgel

Share this post


Link to post
Share on other sites
marhex

 

From what you've provided, the only thing i would see as a problem is the speed of the vehicle.

I believe that 550f is way to much, i would recommend doing this instead

Hash veh_racer1_hash = veh_racer1.GetHashCode();float veh_racer1_max = Function.Call<float>GET_VEHICLE_MAX_SPEED(veh_racer1_hash)racer01Task.AddTask.DriveTo(veh_racer1, chackpoints[i], 15f, veh_racer1_max, (int)DrivingStyle.Rushed);

the proplem that the racer is driving very bad

and they very easy to win

Share this post


Link to post
Share on other sites
Mgel

 

 

From what you've provided, the only thing i would see as a problem is the speed of the vehicle.

I believe that 550f is way to much, i would recommend doing this instead

Hash veh_racer1_hash = veh_racer1.GetHashCode();float veh_racer1_max = Function.Call<float>GET_VEHICLE_MAX_SPEED(veh_racer1_hash)racer01Task.AddTask.DriveTo(veh_racer1, chackpoints[i], 15f, veh_racer1_max, (int)DrivingStyle.Rushed);

the proplem that the racer is driving very bad

and they very easy to win

 

That might be because the definition in ScriptHook is as such:

void Tasks::DriveTo(Vehicle ^vehicle, Math::Vector3 position, float radius, float speed){    DriveTo(vehicle, position, radius, speed, 0);}void Tasks::DriveTo(Vehicle ^vehicle, Math::Vector3 position, float radius, float speed, int drivingstyle){    Native::Function::Call(Native::Hash::TASK_VEHICLE_DRIVE_TO_COORD_LONGRANGE, this->mPed->Handle, vehicle->Handle, position.X, position.Y, position.Z, speed, drivingstyle, radius);}

Which only use the Longrange edition.

But on NativeDB two functions exist.

Check out the documentation of both

void TASK_VEHICLE_DRIVE_TO_COORD(Ped ped, Vehicle vehicle, float x, float y, float z, float speed, Any p6, Hash vehicleModel, int drivingMode, float p9, float p10) // E2A2AA2F659D77A7 E4AC0387

and

void TASK_VEHICLE_DRIVE_TO_COORD_LONGRANGE(Ped ped, Vehicle vehicle, float x, float y, float z, float speed, int driving_mode, float stop_range) // 158BB33F920D360C 1490182A

They have a good description of how they work.

Try playing around with some of the parameters to see if you can achieve what you want.

Edited by Mgel

Share this post


Link to post
Share on other sites
marhex

 

void TASK_VEHICLE_DRIVE_TO_COORD(Ped ped, Vehicle vehicle, float x, float y, float z, float speed, Any p6, Hash vehicleModel, int drivingMode, float p9, float p10) // E2A2AA2F659D77A7 E4AC0387

i am using c# and i can't use Hash vehicleModel in my code

Function.Call(Hash.TASK_VEHICLE_DRIVE_TO_COORD, racer1, veh_racer1, chackpoints[racer1_ch].X, chackpoints[racer1_ch].Y, chackpoints[racer1_ch].Z

, Function.Call<float>(Hash._0xF417C2502FFFED43, veh_racer1.GetHashCode()), 1, VehicleHash.Comet2, (int)DrivingStyle.AvoidTrafficExtremely, 0xC00AB, -1);

i have this error

cannot convert from 'GTA.Native.VehicleHash' to 'GTA.Native.InputArgument'

 

Edited by marhex

Share this post


Link to post
Share on other sites
CamxxCore

 

 

void TASK_VEHICLE_DRIVE_TO_COORD(Ped ped, Vehicle vehicle, float x, float y, float z, float speed, Any p6, Hash vehicleModel, int drivingMode, float p9, float p10) // E2A2AA2F659D77A7 E4AC0387
i am using c# and i can't use Hash vehicleModel in my code

Function.Call(Hash.TASK_VEHICLE_DRIVE_TO_COORD, racer1, veh_racer1, chackpoints[racer1_ch].X, chackpoints[racer1_ch].Y, chackpoints[racer1_ch].Z

, Function.Call<float>(Hash._0xF417C2502FFFED43, veh_racer1.GetHashCode()), 1, VehicleHash.Comet2, (int)DrivingStyle.AvoidTrafficExtremely, 0xC00AB, -1);

i have this error

cannot convert from 'GTA.Native.VehicleHash' to 'GTA.Native.InputArgument'

 

 

GetHashCode is part of System.Object. Not what you want. You should be using the handle when you want to pass the ped as an argument

Share this post


Link to post
Share on other sites
marhex

 

 

void TASK_VEHICLE_DRIVE_TO_COORD(Ped ped, Vehicle vehicle, float x, float y, float z, float speed, Any p6, Hash vehicleModel, int drivingMode, float p9, float p10) // E2A2AA2F659D77A7 E4AC0387
i am using c# and i can't use Hash vehicleModel in my code

Function.Call(Hash.TASK_VEHICLE_DRIVE_TO_COORD, racer1, veh_racer1, chackpoints[racer1_ch].X, chackpoints[racer1_ch].Y, chackpoints[racer1_ch].Z

, Function.Call<float>(Hash._0xF417C2502FFFED43, veh_racer1.GetHashCode()), 1, VehicleHash.Comet2, (int)DrivingStyle.AvoidTrafficExtremely, 0xC00AB, -1);

i have this error

cannot convert from 'GTA.Native.VehicleHash' to 'GTA.Native.InputArgument'

 

GetHashCode is part of System.Object. Not what you want. You should be using the handle when you want to pass the ped as an argument

 

that is the function i use

 

int vv = unchecked((int)VehicleHash.Comet2);

Function.Call(Hash.TASK_VEHICLE_DRIVE_TO_COORD, racer2, veh_racer2, chackpoints.X, chackpoints.Y, chackpoints.Z

, Function.Call<float>(Hash._GET_VEHICLE_MAX_SPEED, veh_racer2.GetHashCode()), 1, vv, (int)DrivingStyle.AvoidTrafficExtremely, 0xC00AB, -1);

but it dosn't work

Share this post


Link to post
Share on other sites
CamxxCore

 

 

 

void TASK_VEHICLE_DRIVE_TO_COORD(Ped ped, Vehicle vehicle, float x, float y, float z, float speed, Any p6, Hash vehicleModel, int drivingMode, float p9, float p10) // E2A2AA2F659D77A7 E4AC0387
i am using c# and i can't use Hash vehicleModel in my code

Function.Call(Hash.TASK_VEHICLE_DRIVE_TO_COORD, racer1, veh_racer1, chackpoints[racer1_ch].X, chackpoints[racer1_ch].Y, chackpoints[racer1_ch].Z

, Function.Call<float>(Hash._0xF417C2502FFFED43, veh_racer1.GetHashCode()), 1, VehicleHash.Comet2, (int)DrivingStyle.AvoidTrafficExtremely, 0xC00AB, -1);

i have this error

cannot convert from 'GTA.Native.VehicleHash' to 'GTA.Native.InputArgument'

GetHashCode is part of System.Object. Not what you want. You should be using the handle when you want to pass the ped as an argument

 

that is the function i use

 

int vv = unchecked((int)VehicleHash.Comet2);

Function.Call(Hash.TASK_VEHICLE_DRIVE_TO_COORD, racer2, veh_racer2, chackpoints.X, chackpoints.Y, chackpoints.Z

, Function.Call<float>(Hash._GET_VEHICLE_MAX_SPEED, veh_racer2.GetHashCode()), 1, vv, (int)DrivingStyle.AvoidTrafficExtremely, 0xC00AB, -1);

but it dosn't work

 

 

That is so hard on my eyes :/ You should use a code block to make your code more readable. But with the first line, you don't need to be using unchecked syntax here. Do something like..

Model model = new Model(VehicleHash.Comet2);

and use

model.Hash
Edited by CamxxCore

Share this post


Link to post
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.
Note: Your post will require moderator approval before it will be visible.

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.

Sign in to follow this  

  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.