|
 |
|
|
|
|
|
GTA Modification Forums
[Q] Parking sensors Parking sensors for GTA SA
 |
|
 |
| |
Pie015  |
Posted: Thursday, Nov 10 2011, 20:44
|
6 STAR VETERAN

Group: Members
Joined: Jun 11, 2010


|
| CODE | | 01B0: car 71@ sphere 0 in_sphere 2644.462 -2017.282 12.5547 radius 4.0 4.0 4.0 stopped |
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
G-Modifications  |
|
G

Group: Members
Joined: Oct 24, 2011


|
Alright I will try this. It's strange that almost nobody made a parking sensor mod. When I drive reverse I always hit something  . G-Modifications EDIT: I've tried it and it won't work. Can someone help me, please? G-Modifications This post has been edited by G-Modifications on Friday, Nov 11 2011, 13:31
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
SilentPL  |
|
Senior File Manager

Group: Members
Joined: Feb 1, 2010



|
Untested, but should work. It's not very "professional", as it doesn't get the real rear bumper coordinates etc. Also, I'm not sure if I didn't mistake the dimensions - if it doesn't work, try to switch dimensionA vars with dimensionB vars. [old code was here] I bet it doesn't work though, damn my hate for testing scripts in game  Edit: Doesn't work, guess I'll have to test it once. Edit2: This one works well: | CODE | {$CLEO} 0000: SENSORS
const NUM_PARKING_SENSORS = 4 // Customize to adjust the amount of parking sensors (shouldn't be lower than 2 though) MAX_SENSOR_RANGE = 3.0 // Max distance to any obstacle SOUND_RACE_321 = 1056 SOUND_RACE_GO = 1057 // Original R* names for these sounds :) end
while true 0001: wait 0 ms if 00DF: actor $PLAYER_ACTOR driving then 03C0: 0@ = actor $PLAYER_ACTOR car 02E3: 1@ = car 0@ speed if 0023: 15.0 > 1@ then 0441: 1@ = car 0@ model if 0A01: model 1@ car then 07E4: get_model 1@ dimensions_cornerA_to 2@ 3@ 4@ dimensions_cornerB_to 5@ 6@ 7@ 000B: 2@ += 0.25 000F: 5@ -= 0.25 0087: 8@ = 5@ // (float) 0087: 11@ = 2@ // (float) 0063: 8@ -= 2@ // (float) 0087: 9@ = 8@ // (float) 0006: 10@ = NUM_PARKING_SENSORS 000E: 10@ -= 1 0093: 10@ = integer 10@ to_float 0073: 9@ /= 10@ // (float) 0087: 13@ = 3@ // (float) 000F: 13@ -= MAX_SENSOR_RANGE 0006: 14@ = false 0007: 21@ = -100.0 for 12@ = 1 to NUM_PARKING_SENSORS 0407: store_coords_to 15@ 16@ 17@ from_car 0@ with_offset 11@ 3@ -0.1 0407: store_coords_to 18@ 19@ 20@ from_car 0@ with_offset 11@ 13@ -0.1 if 86BD: not no_obstacles_between 15@ 16@ 17@ and 18@ 19@ 20@ solid 1 car 1 actor 1 object 1 particle 0 then 0006: 14@ = true 0087: 22@ = 13@ // (float) repeat 000B: 22@ += 0.1 if 0025: 22@ > 21@ // (float) then 0087: 21@ = 22@ // (float) end 0407: store_coords_to 15@ 16@ 17@ from_car 0@ with_offset 11@ 3@ -0.1 0407: store_coords_to 18@ 19@ 20@ from_car 0@ with_offset 11@ 22@ -0.1 until 06BD: no_obstacles_between 15@ 16@ 17@ and 18@ 19@ 20@ solid 1 car 1 actor 1 object 1 particle 0 end 005B: 11@ += 9@ // (float) end if 0039: 14@ == true then 0097: make 21@ absolute_float 006B: 21@ *= 21@ // (float) 006B: 21@ *= 21@ // (float) 0092: 21@ = float 21@ to_integer if 001B: 75 > 21@ then 097A: play_audio_at 0.0 0.0 0.0 event SOUND_RACE_GO else 097A: play_audio_at 0.0 0.0 0.0 event SOUND_RACE_321 end 0001: wait 21@ ms end end end end end
| This post has been edited by SilentPL on Friday, Nov 11 2011, 17:30
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
| |
 |
|
 |
|
|
|
|