-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IsPlayerDrivingDangerously #813
IsPlayerDrivingDangerously #813
Conversation
GET_IS_PLAYER_DRIVING_WRECKLESS |
I will not apply this due to the origin of it unless I get told to do otherwise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked up the native in IDA and p2
may be some sort of type, it ranges from 0
to 2
.
Apparently 2
is against traffic as you're saying, but then I looked up other offsets that the native checks depending on p2
and there's a check for traffic lights. I noticed it was traffic lights since I did some research on junctions and traffic lights a while ago and that offset led me there. Pseudo-code provided for demonstration purposes only.
Notice the comment (names are speculative guesses):
And p2
being 1
matches 0xbf8
, which is the check for traffic lights, game code specifically checks if a traffic light is red.
So we know two things for sure:
State/Type 1
: Is a check for traffic lights, specifically red.
State/Type 2
: Is a check for driving against traffic as you are saying.
State/Type 0
: Is a check for 'last time driven on pavement', may get set when the player isn't driving on pavement/car is in the air?
Testing reveals that 1 does indeed seem to be for running through red lights, does take a bit of time for it to begin to return true though (which might have something to do with the time mentions there?) Testing with value 0 i could not find any situation in which it would return true. |
a2b1616
to
249179c
Compare
0 is the time since the player drove on pavement, let's check this native and follow the line: Notice Then there's the Maybe not driving on pavement or having the car fly in the air causes the native to return something when calling the |
i believe i tried that while testing all 3 and got nothing. might be non functional |
Added an enum with different violation types. Added type 0 which I was able to test in-game, it only returns true when driving on paved sidewalks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, I tested all this including type 0
which I documented, everything works. I'm approving and merging!
Thanks 😊
https://nativedb.dotindustries.dev/gta5/natives/0xF10B44FD479D69F3?search=0xF10B44FD479D69F3+ |
0xF10B44FD479D69F3 is used for a voice line about the player driving in "the correct lanes" (wrong lanes) for nigel2.c