// Made by www.youtube.com/jhgr16
{$CLEO .cs}
//-------------MAIN---------------
03A4: name_thread 'pene'
0390: load_txd_dictionary "PAMIRA"
038F: load_texture "MIRA" as 1 // Load dictionary with 0390 first
038F: load_texture "MIRA4" as 2
038F: load_texture "MIRA2" as 3 // Load dictionary with 0390 first
038F: load_texture "MIRA3" as 4
if
0AAB: file_exists "CLEO\aircraftaim.ini"
then
0AF0: 23@ = get_int_from_ini_file "cleo\aircraftaim.ini" section "CROSSHAIR" key "red"
0AF0: 24@ = get_int_from_ini_file "cleo\aircraftaim.ini" section "CROSSHAIR" key "green"
0AF0: 25@ = get_int_from_ini_file "cleo\aircraftaim.ini" section "CROSSHAIR" key "blue"
0AF0: 26@ = get_int_from_ini_file "cleo\aircraftaim.ini" section "CROSSHAIR" key "transparency"
0AF0: 27@ = get_int_from_ini_file "cleo\aircraftaim.ini" section "CROSSHAIR" key "crosshair1"
0AF0: 28@ = get_int_from_ini_file "cleo\aircraftaim.ini" section "CROSSHAIR" key "crosshair2"
0AF2: 29@ = get_float_from_ini_file "cleo\aircraftaim.ini" section "CROSSHAIR" key "size"
0AF2: 30@ = get_float_from_ini_file "cleo\aircraftaim.ini" section "CROSSHAIR" key "size2"
0AF2: 31@ = get_float_from_ini_file "cleo\aircraftaim.ini" section "CROSSHAIR" key "distance"
else
23@ = 255
24@ = 255
25@ = 255
26@ = 255
27@ = 3
28@ = 4
29@ = 27.0
30@ = 27.0
end
15@ = 0
32@ = 1
:start
wait 0
IF AND
KEY_DOWN 18
KEY_DOWN 88
THEN
0B12: 15@ = 15@ XOR 1
WAIT 1000
END
if and
15@ == 1
player.Defined(0)
then
if or
00DD: actor $PLAYER_ACTOR driving_car_with_model #SEASPAR
00DD: actor $PLAYER_ACTOR driving_car_with_model #HUNTER
00DD: actor $PLAYER_ACTOR driving_car_with_model #HYDRA
00DD: actor $PLAYER_ACTOR driving_car_with_model #RUSTLER
then
if
32@ == 1
then
print "~B~Vehicles crosshair by ~W~ ~Y~jhgr16~W~" time 3500
32@ = 0
end
0@ = Actor.CurrentCar($PLAYER_ACTOR)
$incar = 1
077D: 1@ = car 0@ x_angle
077D: 1@ = car 0@ x_angle
077D: 1@ = car 0@ x_angle
0174: 2@ = car 0@ Z_angle
00AA: store_car 0@ position_to 3@ 4@ 5@
03F0: enable_text_draw 1
0AB1: call_scm_func @get3DXYZInFrontOf 6 XYZ 3@ 4@ 5@ Z_Angle 2@ Y_Angle 1@ Distance 31@ Return_XYZ_To 6@ 7@ 8@
if
86BD: no_obstacles_between 3@ 4@ 5@ and 6@ 7@ 8@ solid 1 car 0 actor 1 object 1 particle 0
then
0AB1: call_scm_func @getCollisionBetweenPoints 17 from 3@ 4@ 5@ to 6@ 7@ 8@ solid 1 car 0 actor 1 object 1 particle 0 cartyre 0 water 1 ignore_entity 0x0 see_through 0 camera_objects 0 shoot_through 0 store_to 20@ 21@ 22@ distance_to $caca2 entity_to $caca
0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X X 20@ Y 21@ Z 22@ store_screen_X_to 9@ Y_to 10@
else
0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X X 6@ 7@ 8@ store_screen_X_to 9@ Y_to 10@
end
if or
00DD: actor $PLAYER_ACTOR driving_car_with_model #HYDRA
00DD: actor $PLAYER_ACTOR driving_car_with_model #HUNTER
then
038D: draw_texture 27@ position 9@ 10@ size 29@ 29@ RGBA 23@ 24@ 25@ 26@
else
038D: draw_texture 28@ position 9@ 10@ size 30@ 30@ RGBA 23@ 24@ 25@ 26@
end
else
if
$incar == 1
then
if or
80DD: actor $PLAYER_ACTOR driving_car_with_model #SEASPAR
80DD: actor $PLAYER_ACTOR driving_car_with_model #HUNTER
80DD: actor $PLAYER_ACTOR driving_car_with_model #HYDRA
80DD: actor $PLAYER_ACTOR driving_car_with_model #RUSTLER
then
03F0: 0
$incar = 0
end
else
end
end
end
jump @start
:getScreenXYFrom3DCoords // ugbase
0AA7: call_function 0x70CE30 num_params 6 pop 6 clipNear 1 clipFar 1 yMult 7@s xMult 6@s outVector 2@s inVector 0@s result 29@
0073: 2@ /= 6@
0073: 2@ /= 4@
0073: 3@ /= 7@
0073: 3@ /= 4@
2@ *= 640.0
3@ *= 448.0
0AB2: ret 2 2@ 3@
:get3DXYZInFrontOf{X,Y,Z,ZA,YA,Distance}
{
Return:
PosX-InFrontOf
PosY-InFrontOf
PosZ-InFrontOf
Example: 0AB1: call_scm_func @get3DXYZInFrontOf 6 XYZ 1@ 2@ 3@ Z_Angle 4@ Y_Angle 5@ Distance 7.0 Return_XYZ_To 6@ 7@ 8@
}
3@ *= -1.0
02F6: 6@ = sine 3@
006B: 6@ *= 5@
005B: 0@ += 6@
02F7: 6@ = cosine 3@
006B: 6@ *= 5@
005B: 1@ += 6@
02F7: 6@ = cosine 4@
0073: 5@ /= 6@
02F6: 6@ = sine 4@
006B: 5@ *= 6@
005B: 2@ += 5@
0AB2: ret 3 0@ 1@ 2@
:getCollisionBetweenPoints // GTA FORUMS
{
Parameters:
Passed:
0@ - start point X
1@ - start point Y
2@ - start point Z
3@ - end point X
4@ - end point Y
5@ - end point Z
6@ - is solid
7@ - is car
8@ - is actor
9@ - is object
10@ - is particle
11@ - is car tyre
12@ - is water
13@ - entity to ignore (offset)
14@ - no see-through stuff
15@ - no camera objects
16@ - no shoot-through stuff
Result:
17@ - collision point X
18@ - collision point Y
19@ - collision point Z
20@ - distance
21@ - entity
Example:
0AB1: call_scm_func @getCollisionBetweenPoints 17 from 0.0 0.0 0.0 to 1.0 0.0 0.0 solid 0 car 1 actor 0 object 0 particle 0 cartyre 1 water 0 ignore_entity 0x0 see_through 0 camera_objects 0 shoot_through 0 store_to 1@ 2@ 3@ distance_to 4@ entity_to 5@
}
if
13@ <> 0x0
then
0A8C: write_memory 0xB7CD68 size 4 value 13@ virtual_protect 0
end
0A8C: write_memory 0xB7CD70 size 1 value 11@ virtual_protect 0
0A9F: 26@ = current_thread_pointer
0AB1: call_scm_func @getLocalVarOffset 2 thread 26@ var 0 store_to 22@
0AB1: call_scm_func @getLocalVarOffset 2 thread 26@ var 3 store_to 23@
0AB1: call_scm_func @getLocalVarOffset 2 thread 26@ var 17 store_to 24@
0AB1: call_scm_func @getLocalVarOffset 2 thread 26@ var 21 store_to 25@
0AA7: call_function 0x56BA00 num_params 12 pop 12 bIgnoreShootThroughStuff 16@ bIgnoreSomeObjectsForCamera 15@ bIgnoreSeeThroughStuff 14@ bDummy 10@ bObject 9@ bActor 8@ bCar 7@ bBuilding 6@ pEntity 25@ pPoint 24@ pTarget 23@ pOrigin 22@ bReturn 31@ // CWorld__ProcessLineOfSight
if
13@ <> 0x0
then
0A8C: write_memory 0xB7CD68 size 4 value 0x0 virtual_protect 0
end
if
31@ <> 0
then
if and
17@ <> 0.0
18@ <> 0.0
19@ <> 0.0
then
050A: 20@ = distance_between_XYZ 0@ 1@ 2@ and_XYZ 17@ 18@ 19@
if
12@ == 1
then
0A9F: 26@ = current_thread_pointer
0AB1: call_scm_func @getLocalVarOffset 2 thread 26@ var 27 store_to 30@
0AA7: call_function 0x6E61B0 num_params 7 pop 7 pPoint 30@ fTargetZ 5@ fTargetY 4@ fTargetX 3@ fOriginZ 2@ fOriginY 1@ fOriginX 0@ bResult 31@ // CWorld__TestLineAgainstWater
if
31@ <> 0
then
0087: 17@ = 27@
0087: 18@ = 28@
0087: 19@ = 29@
050A: 20@ = distance_between_XYZ 0@ 1@ 2@ and_XYZ 27@ 28@ 29@
end
end
0AB2: ret 5 17@ 18@ 19@ 20@ 21@
end
end
0AB2: ret 5 3@ 4@ 5@ 0.0 0x0
:getLocalVarOffset
{
Parameters:
Passed:
0@ - thread pointer
1@ - var number
Result:
1@ - var value
Example:
0AB1: call_scm_func @getLocalVarOffset 2 thread 0@ var 0 store_to 1@
}
if
0@ <> 0
then
1@ *= 0x4
0A8E: 2@ = 0@ + 0xDC // mission flag
if
2@ == 1
then
1@ += 0xA48960 // mission locals
else
005A: 1@ += 0@
1@ += 0x3C
end
else
1@ = 0
end
0AB2: ret 1 1@