Jump to content

[HELP] Walking race


Mige

Recommended Posts

Hey

So I have been editing the base race scripts to allow getting out of the starting vehicle and change to whatever vehicle you find.

- However I noticed u can walk through vehicles and also if I walk through a checkpoint instead of using a vehicle it will just finish the race for me.. can't seem to find where this stuff is handled so help would be appreciated.

Edited by Mige
Link to post

I'm not sure how well this would work because the race resource is specifically built assuming players are in vehicles.

This is where race handles checkpoint hits: https://github.com/multitheftauto/mtasa-resources/blob/master/[gamemodes]/[race]/race/race_client.lua#L700-L746

As you can see, it assumes a vehicle, and will return at 

if elem ~= g_Vehicle or isVehicleBlown(g_Vehicle) or getElementHealth(g_Me) == 0 or Spectate.active then
  return
end

 

Link to post
40 minutes ago, AfuSensi said:

I'm not sure how well this would work because the race resource is specifically built assuming players are in vehicles.

This is where race handles checkpoint hits: https://github.com/multitheftauto/mtasa-resources/blob/master/[gamemodes]/[race]/race/race_client.lua#L700-L746

As you can see, it assumes a vehicle, and will return at 


if elem ~= g_Vehicle or isVehicleBlown(g_Vehicle) or getElementHealth(g_Me) == 0 or Spectate.active then
  return
end

 

Yeah I have edited that part to: (with this im able to walk through the first checkpoint, but for some reason that causes the race to finish instead)

if (elem ~= g_Vehicle and tostring(g_Vehicle) ~= "false") or isVehicleBlown(g_Vehicle) or getElementHealth(g_Me) == 0 or Spectate.active then

 

Link to post
9 minutes ago, AfuSensi said:

If you follow the call chain, you will see a lot more vehicle dependencies. That's just the first place it checks for a vehicle.

Ye, but this is the point where its checking the checkpoints so shouldnt the problem be here somewhere.

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...