{$CLEO .cs}
{$USE ini}
0000:
:TheBoys
wait 0
if
0ADC: "Tre"
jf @TheBoys
0665: get_actor $PLAYER_ACTOR model_to 0@
if
not 0@==#SPECIAL01
jf @TheBoys
0247: load_model #BRASSKNUCKLE
04ED: load_animation "TheBoys"
0390: load_txd_dictionary 'TheBoys'
038F: load_texture "lockon" as 1
038F: load_texture "crossh" as 2
023C: load_special_actor 'Train' as 1
038B: load_requested_models
wait 150
0665: get_actor $PLAYER_ACTOR model_to $288
048F: actor $PLAYER_ACTOR remove_weapons
0223: set_actor $PLAYER_ACTOR health_to 500
0489: set_actor $PLAYER_ACTOR muted 1
0330: set_player $PLAYER_CHAR infinite_run 1
09C7: change_player $PLAYER_CHAR model_to #SPECIAL01
0792: disembark_instantly_actor $PLAYER_ACTOR
gosub @Speed
$grabp=0
$fall=0
$trgt=0
$time=0
$slowm=0
jump @TheBoys_A

:TheBoys_A
wait 0
if
8ADC: not "Trf"
jf @TheBoys_F
gosub @Abils
jump @TheBoys_A

:TheBoys_F
wait 0
$grabp=0
$fall=0
$trgt=0
$time=0
$slowm=0
0247: load_model #BRASSKNUCKLE
04ED: load_animation "TheBoys"
0390: load_txd_dictionary 'TheBoys'
038F: load_texture "lockon" as 1
038F: load_texture "crossh" as 2
023C: load_special_actor 'Train' as 1
038B: load_requested_models
wait 150
048F: actor $PLAYER_ACTOR remove_weapons
0223: set_actor $PLAYER_ACTOR health_to 500
0489: set_actor $PLAYER_ACTOR muted 0
0330: set_player $PLAYER_CHAR infinite_run 0
09C7: change_player $PLAYER_CHAR model_to $288
0792: disembark_instantly_actor $PLAYER_ACTOR
0391: release_textures
04EF: release_animation "TheBoys"
0249: release_model #BRASSKNUCKLE
0296: unload_special_actor 1
jump @TheBoys

//=========================GOSUB=========================\\

:Abils
if and
0AB0: 87
0AB0: 32
then
    gosub @Sounds  
    if
    $grabp==0
    then
        repeat
            wait 0                      
            if
            8611: not actor $PLAYER_ACTOR performing_animation "T_sprint"
            then
                gosub @FallA
                gosub @Speed                                                          
                0605: actor $PLAYER_ACTOR perform_animation "T_sprint" IFP "TheBoys" framedelta 300.0 loop 0 lockX 1 lockY 1 lockF 0 time -1                       
            else
                $trgt=1            
                gosub @Pimpact
                gosub @VehA                
                0AB1: call_scm_func @AIM 1 1.0 1@ 2@ 3@     
                gosub @PedA     
                015D: set_gamespeed $slt
                0605: actor $PLAYER_ACTOR perform_animation "T_sprint" IFP "TheBoys" framedelta 300.0 loop 0 lockX 1 lockY 1 lockF 0 time -1 
                0393: actor $PLAYER_ACTOR perform_animation "T_sprint" at $sps times_normal_rate
                0687: clear_actor $player_actor task
                0AB1: call_scm_func @rotation 0 5@ 4@
                0173: set_actor $PLAYER_ACTOR Z_angle_to 5@                                           
            end
            if
            0AB0: 16
            then
                if
                $fall==0
                then
                    083C: set_actor $PLAYER_ACTOR velocity_in_direction_XYZ 0.0 0.0 18.0
                    wait 50
                    0AB1: @DISABLE_VELOCITY_Z_LIMIT 1 TRUE
                    04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
                    04C4: store_coords_to 7@ 8@ 9@ from_actor $PLAYER_ACTOR with_offset 0.0 38.0 21.0
                    0063: 7@ -= 1@
                    0063: 8@ -= 2@
                    0063: 9@ -= 3@
                    083C: set_actor $PLAYER_ACTOR velocity_in_direction_XYZ 7@ 8@ 9@
                end
            end                        
            if
            0818:  actor $PLAYER_ACTOR in_air
            then
                if
                $fall==0
                then
                    $fall=1
                end
            else
                if
                $fall==1
                then
                    $fall=0
                    gosub @PutAT
                end
            end
            if
            $time>0
            then
                $time-=1
            else
                $time=0
            end            
            gosub @FastA          
        until 8AB0: not 32
        $trgt=0
        gosub @Sounds
        if
        $slowm==0
        then
            015D: set_gamespeed 1.0
        end 
    end       
end
if
0611: actor $PLAYER_ACTOR performing_animation "T_sprint"
then
    if
    8AB0: not 32
    then
        0812: AS_actor $PLAYER_ACTOR perform_animation "T_stop" IFP "TheBoys" framedelta 4.0 loopA 0 lockX 1 lockY 1 lockF 0 time -1  // versionB
        wait 870
        0792: disembark_instantly_actor $PLAYER_ACTOR
    end
end
if
0AB0: 2
then
    if
    8611: not actor $PLAYER_ACTOR performing_animation "T_sprint"
    then
        if
        $trgt==0
        then
            $trgt=1
            0AAE: remove_audio_stream 10@
            0AAC: 10@ = load_audio_stream "CLEO\Sounds\slow_s.wav"
            0ABC: set_audio_stream 10@ volume 0.5
            0AAD: set_audio_stream 10@ state 1   
        else
            0AB1: call_scm_func @AIM 1 1.0 1@ 2@ 3@                                 
            gosub @PedA            
            gosub @Lock
            015D: set_gamespeed 0.35
            0AB1: call_scm_func @rotation 0 5@ 4@
            0173: set_actor $PLAYER_ACTOR Z_angle_to 5@
        end
    end
else    
    015D: set_gamespeed 1.0
end   
if
0AB0: 9
then
    if
    $time==0
    then
        if
        $slowm==0
        then
            $time=8
            $slowm=1
            gosub @Speed
            0AAE: remove_audio_stream 10@
            0AAC: 10@ = load_audio_stream "CLEO\Sounds\slow_s.wav"
            0ABC: set_audio_stream 10@ volume 0.5
            0AAD: set_audio_stream 10@ state 1               
            015D: set_gamespeed $slt
        else
            $time=8
            $slowm=0
            0AAE: remove_audio_stream 10@
            0AAC: 10@ = load_audio_stream "CLEO\Sounds\slow_e.wav"
            0ABC: set_audio_stream 10@ volume 0.5
            0AAD: set_audio_stream 10@ state 1               
            015D: set_gamespeed 1.0
        end
    end
end
if
$slowm==1
then
    gosub @FastA
    015D: set_gamespeed $slt
end 
if
$time>0
then
    $time-=1
else
    $time=0
end           
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 1.0 0.0             
gosub @PedA
gosub @FallA    
0223: set_actor $PLAYER_ACTOR health_to 500
02AB: set_actor $PLAYER_ACTOR immunities BP 1 FP 1 EP 1 CP 1 MP 1    
return   

:FallA
if and
84AD: not actor $PLAYER_ACTOR in_water
0818:  actor $PLAYER_ACTOR in_air
then
    if
    $fall==0
    then
        $fall=1                      
    end
else
    if
    $fall==1
    then     
        $fall=0           
        0792: disembark_instantly_actor $PLAYER_ACTOR    
    end
end
return 

:Sounds
0AAE: remove_audio_stream 10@
0AAC: 10@ = load_audio_stream "CLEO\Sounds\Train_r.mp3"        
0ABC: set_audio_stream 10@ volume 0.5
0AAD: set_audio_stream 10@ state 1  
return

:Speed
$slt = 0.4
$sps = 2.5
return

:Lock
0AB1: call_scm_func @AIM 1 1.0 7@ 8@ 9@
0AB1: call_scm_func @getScreenXYFrom3DCoords 3 coords_XYZ 7@ 8@ 9@ store_to 2@ 3@ 
03F0: enable_text_draw 1 
03E3: set_texture_to_be_drawn_antialiased 1
038D: draw_texture 1 position 2@ 3@ size 32.0 32.0 RGBA 255 255 255 255
return

:Timer
if
$time>0
then
    $time-=1
else
    $time=0
end
return

:FastA
0393: actor $PLAYER_ACTOR perform_animation "FightA_1" at $sps times_normal_rate
0393: actor $PLAYER_ACTOR perform_animation "FightA_2" at $sps times_normal_rate
0393: actor $PLAYER_ACTOR perform_animation "FightA_3" at $sps times_normal_rate
0393: actor $PLAYER_ACTOR perform_animation "Fall_Fall" at $sps times_normal_rate
0393: actor $PLAYER_ACTOR perform_animation "Fall_Glide" at $sps times_normal_rate 
return

:PutAT
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
000B: 3@ += -1.4 
00A1: put_actor $PLAYER_ACTOR at 1@ 2@ 3@
return

:PedA
0A8D: 29@ = read_memory 12010640 size 4 virtual_protect 0 
000A: 29@ += 4 
0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0 
0006: 30@ = 0 

:PedS
0A8D: 31@ = read_memory 29@ size 1 virtual_protect 0 
000A: 29@ += 1 
00D6: if and
0029: 31@ >= 0 
001B: 128 > 31@
jf @PedR
005A: 31@ += 30@ // (int) 
00D6: if and
056D: actor 31@ defined 
803C: not $PLAYER_ACTOR == 31@ // (int)
jf @PedR
if and
8118: not actor 31@ dead
80DF: not actor 31@ driving 
00FE: actor 31@ sphere 0 in_sphere 1@ 2@ 3@ radius 0.3 0.8 1.7
jf @PedR
04C4: store_coords_to 7@ 8@ 9@ from_actor 31@ with_offset 0.0 0.0 0.7
0AB1: call_scm_func @getScreenXYFrom3DCoords 3 coords_XYZ 7@ 8@ 9@ store_to 2@ 3@ 
03F0: enable_text_draw 1 
03E3: set_texture_to_be_drawn_antialiased 1
038D: draw_texture 1 position 2@ 3@ size 48.0 48.0 RGBA 255 255 255 255
if
0AB0: 69
jf @PedD1
015D: set_gamespeed 1.0
if                                                                                                                                 
83CA: not object $grab exists
jf @PedR
if
$trgt==1
then
    gosub @Sounds
    wait 150
    04C4: store_coords_to 1@ 2@ 3@ from_actor 31@ with_offset 0.0 -1.0 -1.0
    00A1: put_actor $PLAYER_ACTOR at 1@ 2@ 3@
end         
$trgt=0   
$grabp=1
0AB1: Get @BONE_POS 5 actor $PLAYER_ACTOR iboneID 25 offset 0.0 0.0 0.0 store 1@ 2@ 3@   // HEAD   ZYX
0107: $grab = create_object #BRASSKNUCKLE at 1@ 2@ 3@
0750: set_object $grab visibility 0
04F4: put_actor 31@ into_turret_on_object $grab offset_from_object_origin 0.0 0.0 0.0 orientation 0 both_side_angle_limit 0.0 lock_weapon 0
wait 0
015D: set_gamespeed 1.0
0812: AS_actor $PLAYER_ACTOR perform_animation "Train_G" IFP "TheBoys" framedelta 4.0 loopA 0 lockX 1 lockY 1 lockF 0 time -1  // versionB
0619: enable_actor 31@ collision_detection 0
0792: disembark_instantly_actor 31@  
wait 0
0812: AS_actor 31@ perform_animation "Ped_D" IFP "TheBoys" framedelta 4.0 loopA 0 lockX 1 lockY 1 lockF 1 time -1  // versionB        
069B: attach_object $grab to_actor $PLAYER_ACTOR with_offset -0.4 -0.8 0.2 rotation 0.0 0.0 0.0
gosub @GrabP
jump @PedR

:PedR
000A: 30@ += 256 
if                               
0019: 30@ > 35584
jf @PedS
return

:PedD1
if
0AB0: 82
jf @PedD2
015D: set_gamespeed 1.0
if
$trgt==1
then
    gosub @Sounds
    wait 150
    04C4: store_coords_to 1@ 2@ 3@ from_actor 31@ with_offset 0.0 -1.0 -1.0
    00A1: put_actor $PLAYER_ACTOR at 1@ 2@ 3@
end     
$trgt=0       
0AAE: remove_audio_stream 10@
0AAC: 10@ = load_audio_stream "CLEO\Sounds\neck_snp.wav"
0ABC: set_audio_stream 10@ volume 0.5
0AAD: set_audio_stream 10@ state 1
0792: disembark_instantly_actor 31@
0812: AS_actor $PLAYER_ACTOR perform_animation "Neck_G" IFP "TheBoys" framedelta 4.0 loopA 0 lockX 1 lockY 1 lockF 1 time -1  // versionB
0812: AS_actor 31@ perform_animation "Ped_D" IFP "TheBoys" framedelta 4.0 loopA 0 lockX 1 lockY 1 lockF 1 time -1  // versionB
repeat
    wait 0
    0393: actor $PLAYER_ACTOR perform_animation "Neck_G" at 1.6 times_normal_rate
    0393: actor 31@ perform_animation "Ped_D" at 1.6 times_normal_rate
    0613: 17@ = actor $PLAYER_ACTOR animation "Neck_G" time
until 17@>0.95
0792: disembark_instantly_actor 31@
0792: disembark_instantly_actor $PLAYER_ACTOR
0223: set_actor 31@ health_to -20
0321: AS_actor 31@ die_headshotted
jump @PedR

:PedD2
if
0AB0: 71
jf @PedD3
if
$trgt==1
then
    gosub @Sounds
    wait 150
    04C4: store_coords_to 1@ 2@ 3@ from_actor 31@ with_offset 0.0 -1.0 -1.0
    00A1: put_actor $PLAYER_ACTOR at 1@ 2@ 3@
end         
$trgt=0  
0AAE: remove_audio_stream 10@
0AAC: 10@ = load_audio_stream "CLEO\Sounds\Rev_R.mp3"        
0ABC: set_audio_stream 10@ volume 0.5
0AAD: set_audio_stream 10@ state 1  
0792: disembark_instantly_actor 31@
04D7: set_actor 31@ locked 1
04D7: set_actor $PLAYER_ACTOR locked 1
04C4: store_coords_to 1@ 2@ 3@ from_actor 31@ with_offset 0.0 1.0 -1.0
00A1: put_actor $PLAYER_ACTOR at 1@ 2@ 3@
0172: 13@ = actor 31@ Z_angle
13@+=-180.0
0173: set_actor $PLAYER_ACTOR Z_angle_to 13@
0812: AS_actor $PLAYER_ACTOR perform_animation "Ped_P" IFP "TheBoys" framedelta 4.0 loopA 0 lockX 1 lockY 1 lockF 1 time -1  // versionB
0812: AS_actor 31@ perform_animation "Idle_Stance" IFP "Ped" framedelta 4.0 loopA 0 lockX 1 lockY 1 lockF 1 time -1  // versionB
wait 300
04D7: set_actor 31@ locked 0
04D7: set_actor $PLAYER_ACTOR locked 0
0792: disembark_instantly_actor 31@
0AAE: remove_audio_stream 12@
0AAC: 12@ = load_audio_stream "CLEO\Sounds\death_hug.wav"        
0ABC: set_audio_stream 12@ volume 0.5
0AAD: set_audio_stream 12@ state 1  
04C4: store_coords_to 1@ 2@ 3@ from_actor 31@ with_offset 0.0 -0.2 0.0
064B: 0@ = create_particle "headshot" at 1@ 2@ 3@ type 1
064F: remove_references_to_particle 0@
wait 400
0223: set_actor 31@ health_to -500
0792: disembark_instantly_actor $PLAYER_ACTOR
jump @PedR

:PedD3
if
$slowm==1
jf @PedR
if
051A: actor 31@ damaged_by_actor $PLAYER_ACTOR
jf @PedR
083C: set_actor 31@ velocity_in_direction_XYZ 0.0 0.0 13.0
wait 50
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
04C4: store_coords_to 7@ 8@ 9@ from_actor $PLAYER_ACTOR with_offset 0.0 14.0 13.0
0063: 7@ -= 1@
0063: 8@ -= 2@
0063: 9@ -= 3@
083C: set_actor 31@ velocity_in_direction_XYZ 7@ 8@ 9@
04C4: store_coords_to 1@ 2@ 3@ from_actor 31@ with_offset 0.0 0.0 0.7
064B: 0@ = create_particle "headshot" at 1@ 2@ 3@ type 1
064F: remove_references_to_particle 0@
0321: AS_actor 31@ die_headshotted
jump @PedR
 
:GrabP
repeat
    wait 0    
    if 
    0AB0: 87
    //0AB0: 32
    then
        gosub @Sounds
        wait 150   
        repeat
            wait 0
            if
            8611: not actor $PLAYER_ACTOR performing_animation "T_grun"
            then
                17@=0
                0326: $fp = create_actor 31@ fire                                            
                0A1A: actor $PLAYER_ACTOR perform_walk_animation "T_grun" IFP "TheBoys" framedelta 4.0 loopA 1 lockX 1 lockY 1 lockF 1 -1 ms // versionC 
            else
                if
                17@<120
                then
                    17@+=1  
                    //gosub @Partcle  
                    0AF1: write_int 17@ to_ini_file "cleo\config.ini" section "Blood" key "Time"            
                    04C4: store_coords_to 1@ 2@ 3@ from_actor 31@ with_offset 0.0 0.7 -0.2
                    064B: 0@ = create_particle "blood_headshot" at 1@ 2@ 3@ type 1
                    064F: remove_references_to_particle 0@
                    064B: 0@ = create_particle "blood_heli" at 1@ 2@ 3@ type 1
                    064F: remove_references_to_particle 0@
                    04F4: put_actor 31@ into_turret_on_object $grab offset_from_object_origin 0.0 0.0 0.0 orientation 0 both_side_angle_limit 0.0 lock_weapon 0
                    0812: AS_actor 31@ perform_animation "Ped_D" IFP "TheBoys" framedelta 4.0 loopA 0 lockX 1 lockY 1 lockF 1 time -1  // versionB                                  
                    069B: attach_object $grab to_actor $PLAYER_ACTOR with_offset -0.6 -0.8 0.0 rotation 0.0 0.0 0.0
                    015D: set_gamespeed 0.5                    
                    0393: actor $PLAYER_ACTOR perform_animation "T_grun" at 1.6 times_normal_rate
                else
                    0321: AS_actor 31@ die_headshotted
                    02D1: remove_fire $fp
                    0792: disembark_instantly_actor 31@
                    0792: disembark_instantly_actor $PLAYER_ACTOR                    
                    04C4: store_coords_to 1@ 2@ 3@ from_actor 31@ with_offset 0.0 0.0 -0.2
                    09B8: create_blood_gush_at 1@ 2@ 3@ with_offset 1@ 2@ 3@ density 20 on_actor 31@
                    0465: remove_actor 31@ from_turret_mode
                    0792: disembark_instantly_actor 31@
                    0108: destroy_object $grab
                    015D: set_gamespeed 1.0                    
                    0812: AS_actor $PLAYER_ACTOR perform_animation "T_stop" IFP "TheBoys" framedelta 4.0 loopA 0 lockX 1 lockY 1 lockF 0 time -1  // versionB
                    wait 870
                    0792: disembark_instantly_actor $PLAYER_ACTOR                    
                    $grabp=0
                    break                    
                end                       
            end                 
        until 8AB0: not 87
        gosub @Sounds
        if
        $grabp==1
        then
            02D1: remove_fire $fp  
            0792: disembark_instantly_actor $PLAYER_ACTOR       
            0812: AS_actor $PLAYER_ACTOR perform_animation "Train_G" IFP "TheBoys" framedelta 4.0 loopA 0 lockX 1 lockY 1 lockF 1 time -1  // versionB    
            069B: attach_object $grab to_actor $PLAYER_ACTOR with_offset -0.4 -0.9 -0.1 rotation 0.0 0.0 0.0
        end        
    end
    if
    $grabp==1
    then
        if and
        8AB0: not 32
        8AB0: not 87
        then             
            0812: AS_actor 31@ perform_animation "Ped_D" IFP "TheBoys" framedelta 4.0 loopA 0 lockX 1 lockY 1 lockF 1 time -1  // versionB        
            0812: AS_actor $PLAYER_ACTOR perform_animation "Train_G" IFP "TheBoys" framedelta 4.0 loopA 0 lockX 1 lockY 1 lockF 1 time -1  // versionB    
            069B: attach_object $grab to_actor $PLAYER_ACTOR with_offset -0.4 -0.9 -0.1 rotation 0.0 0.0 0.0
        end
    end        
until $grabp==0
gosub @Sounds      
return   

:Pimpact
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 1.0 0.0
if
0AE1: 12@ = random_char_near_point 1@ 2@ 3@ in_radius 0.7 find_next 1 pass_deads 1
then
    if
    80DF: not actor 12@ driving
    then
        if
        8611: not actor 12@ performing_animation "Ped_D" 
        then
            0AAE: remove_audio_stream 10@
            0AAC: 10@ = load_audio_stream "CLEO\Sounds\head_smash.wav"
            0ABC: set_audio_stream 10@ volume 0.5
            0AAD: set_audio_stream 10@ state 1    
            00A0: store_actor 12@ position_to 1@ 2@ 3@
            064B: 0@ = create_particle "blood_headshot" at 1@ 2@ 3@ type 1
            064F: remove_references_to_particle 0@
            064B: 0@ = create_particle "blood_heli" at 1@ 2@ 3@ type 1
            064F: remove_references_to_particle 0@            
            009B: destroy_actor 12@
        end
    end
end
return    

:VehA
0A8D: 29@ = read_memory 12010644 size 4 virtual_protect 0 
000A: 29@ += 4 
0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0 
0006: 30@ = 0 

:VehLock
0A8D: 31@ = read_memory 29@ size 1 virtual_protect 0 
000A: 29@ += 1 
00D6: if and
0029:  31@ >= 0 
001B:  128 > 31@ 
jf @VehR
005A: 31@ += 30@ 
if 
056E: car 31@ defined 
jf @VehR
if
8119: not car 31@ wrecked
jf @VehR
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 1.0 0.0
if
01AF: car 31@ sphere 0 in_sphere 1@ 2@ 3@ radius 2.5 8.5 1.5
jf @VehR
if
8547: not actor $PLAYER_ACTOR colliding_with_car 31@
jf @VehVT
0407: store_coords_to 7@ 8@ 9@ from_car 31@ with_offset 0.0 0.0 0.0
0AB1: call_scm_func @getScreenXYFrom3DCoords 3 coords_XYZ 7@ 8@ 9@ store_to 2@ 3@ 
03F0: enable_text_draw 1 
03E3: set_texture_to_be_drawn_antialiased 1
038D: draw_texture 1 position 2@ 3@ size 64.0 64.0 RGBA 255 255 255 255
jump @VehR

:VehR
000A: 30@ += 256
if 
30@ > 27904
jf @VehLock
return

:VehVT    
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
04C4: store_coords_to 7@ 8@ 9@ from_actor $PLAYER_ACTOR with_offset 0.0 1.2 0.0
0063: 7@ -= 1@
0063: 8@ -= 2@
0063: 9@ -= 3@
07D5: set_car 31@ velocity_in_direction_XYZ 7@ 8@ 9@ rotation_velocitiesXY 0.0 0.0 unk 0.0
0224: set_car 31@ health_to 0
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 -0.7
00A1: put_actor $PLAYER_ACTOR at 1@ 2@ 3@                                                      
jump @VehR

:CordEdit
if
0AB0: 49
then
    0059: $Cx += $Cn
    0AF3: write_float $Cx to_ini_file "CLEO\config.ini" section "CamCord" key "Cx"
else
    if
    0AB0: 50
    then
        0061: $Cx -= $Cn
        0AF3: write_float $Cx to_ini_file "CLEO\config.ini" section "CamCord" key "Cx"
    else
        if
        0AB0: 51
        then
            0059: $Cy += $Cn
            0AF3: write_float $Cy to_ini_file "CLEO\config.ini" section "CamCord" key "Cy"
        else
            if
            0AB0: 52
            then
                0061: $Cy -= $Cn
                0AF3: write_float $Cy to_ini_file "CLEO\config.ini" section "CamCord" key "Cy"
            else
                if
                0AB0: 53
                then
                    0059: $Cz += $Cn
                    0AF3: write_float $Cz to_ini_file "CLEO\config.ini" section "CamCord" key "Cz"
                else
                    if
                    0AB0: 54
                    then
                        0061: $Cz -= $Cn
                        0AF3: write_float $Cz to_ini_file "CLEO\config.ini" section "CamCord" key "Cz"
                    end                    
                end
            end
        end
    end
end
return

//===================SCM===================\\

:attachObjectToActorOnBone
//0AB1: call_scm_func @attachObjectToActorOnBone 6 actor $3 attach_to_object 0@ offset 0.0 0.0 0.0 on_bone 24
0A96: 0@ = actor 0@ struct
0AA6: call_method 0x532B20 struct 0@ num_params 0 pop 0 // sub_532B20
0@ += 0x18 
0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0
0AA7: call_function 0x734A40 num_params 1 pop 1 0@ 0@ // _clumpGetFirstSkinAtomicHAnimHierarchy
if   0@ <> 0
then
   0AA7: call_function 0x7C51A0 num_params 2 pop 2 5@ 0@ 5@ // _RpHAnimIDGetIndex
   0AA7: call_function 0x7C5120 num_params 1 pop 1 0@ 0@ // _RpHAnimHierarchyGetMatrixArray
   5@ *= 0x40
   005A: 5@ += 0@
   0AC7: 6@ = var 2@ offset
   0AA5: call 0x54EEF0 num_params 4 pop 4 6@ 5@ 1 6@ // _transformPoints
   0177: set_object 1@ Z_angle_to 0.0
   0A98: 1@ = object 1@ struct
   1@ += 0x14
   0A8D: 0@ = read_memory 1@ size 4 virtual_protect 0
   1@ -= 0x14
   0AA6: call_method 0x411990 struct 1@ num_params 0 pop 0 // sub_411990
   0AA6: call_method 0x59AD20 struct 0@ num_params 1 pop 0 5@ // CMatrix__copyTo
   0AA6: call_method 0x4241C0 struct 1@ num_params 1 pop 0 6@ // CPlaceable__setPosition
   1@ += 0x18
   0A8D: 7@ = read_memory 1@ size 4 virtual_protect 0
   if   7@ <> 0
   then 
       7@ += 0x4
       0A8D: 7@ = read_memory 7@ size 4 virtual_protect 0
       7@ += 0x10
       0AA6: call_method 0x59AD70 struct 0@ num_params 1 pop 0 7@ // CMatrix__copyTo
       1@ -= 0x18
       0AA6: call_method 0x532B00 struct 1@ num_params 0 pop 0 // _RwFrameUpdateObject
   else
       1@ -= 0x18
       0AA6: call_method 0x532B00 struct 1@ num_params 0 pop 0 // _RwFrameUpdateObject
   end
else  0AB2: ret 0
end
0AB2: ret 0

:BONE_POS
//0AB1: Get @BONE_POS 5 actor $PLAYER_ACTOR iboneID 6 offset 0.0 0.0 0.0 store 1@ 2@ 3@   // HEAD   ZYX
//by J16D
0085: 10@ = 0@ // (int)  actor
0085: 11@ = 1@ // (int)  bone
0087: 16@ = 2@ // (float)  Zoffset
0087: 17@ = 3@ // (float)  Yoffset
0087: 18@ = 4@ // (float)  Xoffset
if  056D:   actor 10@ defined
then
    0A96: 30@ = actor 10@ struct
    if or
    0021:   16@ > 0.0
    0021:   17@ > 0.0
    0021:   18@ > 0.0
    then
        0AC7: 19@ = var 16@ offset
        0AA6: call_method 0x5E01C0 struct 30@ num_params 3 pop 0 bIncludeAnim 0 iBoneID 11@ vOffset 19@     // CPed::GetPedBonePositionWithOffset
    else
        0AA6: call_method 0x5E4280 struct 30@ num_params 3 pop 0 bIncludeAnim 0 iBoneID 11@ vPosition 16@v  // CPed::GetPedBonePosition
    end
end
0AB2: ret 3 16@ 17@ 18@  

:targetXYZ
//0AB1: Get @targetXYZ 1 actor $PLAYER_ACTOR -> coordsXYZ 8@ 9@ 10@
const
    ActorFixPos   = 10@
end
0085: ActorFixPos = 0@ // (int)
068E: get_camera_target_point_to 6@ 7@ 8@ 
068D: get_camera_position_to 3@ 4@ 5@ 
0063: 3@ -= 6@ // (float) 
0063: 4@ -= 7@ // (float) 
0063: 5@ -= 8@ // (float) 
0013: 3@ *= -100.0 
0013: 4@ *= -100.0 
0013: 5@ *= -100.0 
005B: 6@ += 3@ // (float) 
005B: 7@ += 4@ // (float) 
005B: 8@ += 5@ // (float) 
00A0: store_actor ActorFixPos position_to 3@ 4@ 5@
0063: 6@ -= 3@ // (float) 
0063: 7@ -= 4@ // (float) 
0063: 8@ -= 5@ // (float) 
0017: 6@ /= 55.0
0017: 7@ /= 55.0
0017: 8@ /= 55.0
0AB2: ret 3 6@ 7@ 8@

:AIM
4@ = 0.0 

:AIM_1
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 3.0 0.0
0A9F: 5@ = current_thread_pointer 
5@ += 80 
0A8E: 6@ = 5@ + 12 // int 
0AA6: call_method 5327216 struct 11989032 num_params 6 pop 0 6@ 5@ 3@ 2@ 1@ 4@  
if 
86BD:   not no_obstacles_between 1@ 2@ 3@ and 8@ 9@ 10@ solid 1 car 1 actor 1 object 1 particle 0 
jf @AIM_2 
jump @AIM_3 

:AIM_2
4@ += 1.0 
4@ > 20.0 // (float)
jf @AIM_1 

:AIM_3
0@ = 0.0 
1@ = 0.0 
2@ = 0.0 
005B: 0@ += 8@ // (float) 
005B: 1@ += 9@ // (float) 
005B: 2@ += 10@ // (float) 
4@ = 0.0 
0AB2: ret 3 0@ 1@ 2@ 

:getScreenXYFrom3DCoords
//0AB1: call_scm_func @getScreenXYFrom3DCoords 3 coords_XYZ 2488.562 -1666.865 12.8757 store_to 1@ 2@ 
0AB1: call_scm_func @getLocalVarOffset 1 var 0 store_to 7@ 
0AB1: call_scm_func @getLocalVarOffset 1 var 3 store_to 8@ 
0AB1: call_scm_func @getLocalVarOffset 1 var 5 store_to 9@ 
0AB1: call_scm_func @getLocalVarOffset 1 var 6 store_to 10@ 
0AA5: call 0x70CE30 num_params 6 pop 6 bFarClip 0 bNearClip 0 pMultY 10@ pMultX 9@ pScreen 8@ pCoords 7@ 
0AB1: call_scm_func @getScreenXY 2 coords_XY 3@ 4@ store_to 3@ 4@ 
0AB2: ret 2 3@ 4@ 

:getScreenXY
//0AB1: call_scm_func @getScreenXY 2 coords_XY 512.0 384.0 store_to 1@ 2@ 
0A8D: 2@ = read_memory 0xC17044 size 4 virtual_protect 0 // full screen X
0A8D: 3@ = read_memory 0x859520 size 4 virtual_protect 0 // screen X scale
0093: 2@ = integer 2@ to_float
006B: 2@ *= 3@ 
0073: 0@ /= 2@ 
0A8D: 5@ = read_memory 0xC17048 size 4 virtual_protect 0 // full screen Y
0A8D: 6@ = read_memory 0x859524 size 4 virtual_protect 0 // screen Y scale
0093: 5@ = integer 5@ to_float
006B: 5@ *= 6@ 
0073: 1@ /= 5@ 
0AB2: ret 2 0@ 1@ 

:getLocalVarOffset
//0AB1: call_scm_func @getLocalVarOffset 1 var 0 store_to 1@ 
0@ *= 0x4 
0A9F: 1@ = current_thread_pointer
0A8E: 2@ = 1@ + 0xDC 
0A8D: 2@ = read_memory 2@ size 1 virtual_protect 0 // bMissionFlag
if   2@ == 1 
then
    0@ += 0xA48960 // pMissionLocals
else
    005A: 0@ += 1@ 
    0@ += 0x3C // pThreadLocals
end
0AB2: ret 1 0@

:rotation
Actor.StorePos($PLAYER_ACTOR, 1@, 2@, 3@)
0AA6: call_method 5327216 struct 11989032 num_params 6 pop 0 10787220 10787232 3@ 2@ 1@ 20.0  
0AB1: call_scm_func @rotation_dist 6 $13 $DEFAULT_WAIT_TIME $PHONE_RINGING_FLAG 1@ 2@ 3@ 5@  
0AB1: call_scm_func @rotation_z 4 $13 $DEFAULT_WAIT_TIME 1@ 2@ 4@  
5@ += 90.0 
0AB2: ret 2 4@ 5@ 

:rotation_dist
0509: 6@ = distance_between_XY 0@ 1@ and_XY 3@ 4@ 
0063: 2@ -= 5@ // (float) 
0604: get_Z_angle_for_point 6@ 2@ store_to 7@ 
0AB2: ret 1 7@ 

:rotation_z
0063: 0@ -= 2@ // (float) 
0063: 1@ -= 3@ // (float) 
0604: get_Z_angle_for_point 0@ 1@ store_to 4@ 
0AB2: ret 1 4@

:SetNewAngleDirectionPointCamera
0085: 20@ = 0@ // (int)
068E: get_camera_target_point_to 5@ 1@ 2@
068D: get_camera_position_to 2@ 3@ 4@
var
    5@: float
    1@: float
    2@: float
    3@: float
end
dec(5@, 2@)
dec(1@, 3@)
0604: get_Z_angle_for_point 5@ 1@ store_to 2@
0173: set_actor 20@ Z_angle_to 2@                                        
0AB2: ret 0

:DirectionXYZ
const
    Actor   = 10@
end
0085: Actor = 0@ // (int)
068E: get_camera_target_point_to 6@ 7@ 8@ 
068D: get_camera_position_to 3@ 4@ 5@ 
0063: 3@ -= 6@ // (float) 
0063: 4@ -= 7@ // (float) 
0063: 5@ -= 8@ // (float) 
0013: 3@ *= -100.0 
0013: 4@ *= -100.0 
0013: 5@ *= -100.0 
005B: 6@ += 3@ // (float) 
005B: 7@ += 4@ // (float) 
005B: 8@ += 5@ // (float) 
00A0: store_actor Actor position_to 3@ 4@ 5@
0063: 6@ -= 3@ // (float) 
0063: 7@ -= 4@ // (float) 
0063: 8@ -= 5@ // (float) 
0017: 6@ /= 45.0
0017: 7@ /= 45.0
0017: 8@ /= 45.0
0AB2: ret 3 6@ 7@ 8@

:DISABLE_VELOCITY_Z_LIMIT
//0AB1: @DISABLE_VELOCITY_Z_LIMIT 1 TRUE
// by opcode.exe
if   0@ == 1
then
    0A8C: write_memory 0x5E91CE size 1 value 0x90 virtual_protect 1
    0A8C: write_memory 0x5E91CF size 1 value 0x90 virtual_protect 1
    0A8C: write_memory 0x5E91D0 size 1 value 0x90 virtual_protect 1
    0A8C: write_memory 0x5E91D1 size 1 value 0x90 virtual_protect 1
    0A8C: write_memory 0x5E91D2 size 1 value 0x90 virtual_protect 1
    0A8C: write_memory 0x5E91D3 size 1 value 0x90 virtual_protect 1
    0A8C: write_memory 0x5E91D4 size 1 value 0x90 virtual_protect 1
else
    if   0@ == 0
    then
        0A8C: write_memory 0x5E91CE size 1 value 0xC7 virtual_protect 1
        0A8C: write_memory 0x5E91CF size 1 value 0x46 virtual_protect 1
        0A8C: write_memory 0x5E91D0 size 1 value 0x4C virtual_protect 1
        0A8C: write_memory 0x5E91D1 size 1 value 0    virtual_protect 1
        0A8C: write_memory 0x5E91D2 size 1 value 0    virtual_protect 1
        0A8C: write_memory 0x5E91D3 size 1 value 0x80 virtual_protect 1
        0A8C: write_memory 0x5E91D4 size 1 value 0x3E virtual_protect 1
    end
end
0AB2: ret 0

:s_Obstacles
//0AB1: @s_Obstacles 9 actor PlayerA XYZ 0.0 0.0 -2.0 solid 1 car 1 actor 0 object 1 particle 0
0085: 11@ = 0@ // (int)   Actor
0087: 12@ = 1@ // (float) X
0087: 13@ = 2@ // (float) Y
0087: 14@ = 3@ // (float) Z
0085: 15@ = 4@ // (int)   solid
0085: 16@ = 5@ // (int)   car
0085: 17@ = 6@ // (int)   actor
0085: 18@ = 7@ // (int)   object
0085: 19@ = 8@ // (int)   particle
04C4: store_coords_to 24@ 25@ 26@ from_actor 11@ with_offset 12@ 13@ 14@ 
04C4: store_coords_to 27@ 28@ 29@ from_actor 11@ with_offset 0.0 0.0 0.0 
if  86BD:  obstacles_between 27@ 28@ 29@ and 24@ 25@ 26@ solid 15@ car 16@ actor 17@ object 18@ particle 19@ 
then  0485:  return_true                    
else  059A:  return_false
end
0AB2: ret 0

:sNo_Obstacles
//0AB1: @sNo_Obstacles 9 actor $PLAYER_ACTOR XYZ 0.0 1.5 0.0 solid 1 car 0 actor 0 object 1 particle 0
0085: 11@ = 0@ // (int)   Actor
0087: 12@ = 1@ // (float) X
0087: 13@ = 2@ // (float) Y
0087: 14@ = 3@ // (float) Z
0085: 15@ = 4@ // (int)   solid
0085: 16@ = 5@ // (int)   car
0085: 17@ = 6@ // (int)   actor
0085: 18@ = 7@ // (int)   object
0085: 19@ = 8@ // (int)   particle
04C4: store_coords_to 24@ 25@ 26@ from_actor 11@ with_offset 12@ 13@ 14@ 
04C4: store_coords_to 27@ 28@ 29@ from_actor 11@ with_offset 0.0 0.0 0.0 
if  06BD:  NO_obstacles_between 27@ 28@ 29@ and 24@ 25@ 26@ solid 15@ car 16@ actor 17@ object 18@ particle 19@ 
then  0485:  return_true                    
else  059A:  return_false
end
0AB2: ret 0