- 464
- 213
Здравствуйте. Нужно переделать аимчик:
Нужно сделать в нем:
1) Автоматическую активацию при входе в игру без ввода команды.
2) При вводе /aimcfg ничего в чат не выводилось
P.S. Я рак просто нихера не соображающий.
Код:
{$CLEO .cs}
{$INCLUDE SF}
0000:
repeat
0001: wait 0
until 0AFA: is_samp_available
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
0AB1: call @Configuration 0 29@ 27@ 26@ 25@ 24@ 23@
0B34: samp register_client_command "aimchik" to_label @cmd_hook
0B34: samp register_client_command "aimcfg" to_label @cmd_hook2
0BE2: raknet setup_outcoming_packet_hook @PACKET_SYNC_HOOK
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
while true
0001: wait 0
end
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
:cmd_hook
if 0B61: samp is_local_player_spawned
then
if 30@ == 0
then print "Activated" time 3000
else print "Deactivated" time 3000
end
0B12: 30@ = 30@ XOR 1
end
0B43: samp cmd_ret
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
:cmd_hook2
if 0B61: samp is_local_player_spawned
then
0AC8: 2@ = allocate_memory_size 20
0B35: samp 2@ = get_last_command_params
0AD4: 3@ = scan_string 2@ format "%d %d" 4@ 5@
if 3@ == 2
then
if 4@ == 1
then
0AF8: samp add_message_to_chat "{99CC00}Ïàðàìåòð TargetHookDistance áûë óñïåøíî îáíîâëåí!" 0xFFFFFF
0085: 28@ = 5@
0093: 29@ = integer 28@ to_float
0AF1: write_int 5@ to_ini_file "CLEO\cfg.ini" section "Settings" key "TargetHookDistance"
end
if 4@ == 2
then
0AF8: samp add_message_to_chat "{99CC00}Ïàðàìåòð Detour áûë óñïåøíî îáíîâëåí!" 0xFFFFFF
0085: 27@ = 5@
0AF1: write_int 5@ to_ini_file "CLEO\cfg.ini" section "Settings" key "Detour"
end
if 4@ == 3
then
0AF8: samp add_message_to_chat "{99CC00}Ïàðàìåòð CorrectAngle áûë óñïåøíî îáíîâëåí!" 0xFFFFFF
0085: 26@ = 5@
0AF1: write_int 5@ to_ini_file "CLEO\cfg.ini" section "Settings" key "CorrectAngle"
end
if 4@ == 4
then
0AF8: samp add_message_to_chat "{99CC00}Ïàðàìåòð GiveDamageRPC áûë óñïåøíî îáíîâëåí!" 0xFFFFFF
0085: 25@ = 5@
0AF1: write_int 5@ to_ini_file "CLEO\cfg.ini" section "Settings" key "GiveDamageRPC"
end
if 4@ == 5
then
0AF8: samp add_message_to_chat "{99CC00}Ïàðàìåòð RandomShot áûë óñïåøíî îáíîâëåí!" 0xFFFFFF
0085: 24@ = 5@
0AF1: write_int 5@ to_ini_file "CLEO\cfg.ini" section "Settings" key "RandomShot"
end
if 4@ == 6
then
0AF8: samp add_message_to_chat "{99CC00}Ïàðàìåòð ClistFilter áûë óñïåøíî îáíîâëåí!" 0xFFFFFF
0085: 23@ = 5@
0AF1: write_int 5@ to_ini_file "CLEO\cfg.ini" section "Settings" key "ClistFilter"
end
else 0AF8: samp add_message_to_chat "{99CC00}Ââåäèòå: {00FFFF}/cfgsala {FFCC00}[íîìåð ïàðàìåòðà(1-6)] {FF0000}[çíà÷åíèå]" 0xFFFFFF
end
0AC9: free_allocated_memory 2@
end
0B43: samp cmd_ret
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
:DamageConvert
0001: wait 0
0A96: 2@ = actor $PLAYER_ACTOR struct
2@ += 0x72C
0A8D: 2@ = read_memory 2@ size 1 virtual_protect 0
0470: 0@ = actor $PLAYER_ACTOR current_weapon
0085: 1@ = 0@
if 2@ == 2
then 1@ += 25
end
if 2@ == 3
then 1@ += 36
end
1@ *= 112
1@ += 13150904
1@ += 0x22
0A8D: 1@ = read_memory 1@ size 2 virtual_protect 0
0093: 1@ = integer 1@ to_float
if and
0@ >= 22
0@ <> 25
0@ <> 26
0@ <> 27
0@ <= 34
then 1@ /= 3.0434782608695652173913043478261
end
0AB2: ret 1 1@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
:GiveTakeDamageRPC
0001: wait 0
0B3D: raknet 4@ = new_bit_stream
0B40: raknet bit_stream 4@ write 0 type BS_TYPE_BOOL size 1
0B40: raknet bit_stream 4@ write 0@ type BS_TYPE_SHORT size 2
0B40: raknet bit_stream 4@ write 1@ type BS_TYPE_FLOAT size 4
0B40: raknet bit_stream 4@ write 2@ type BS_TYPE_INT size 4
0B40: raknet bit_stream 4@ write 3 type BS_TYPE_INT size 4
0B8A: raknet send_rpc 115 bit_stream 4@
0B3E: raknet delete_bit_stream 4@
0AB2: ret 0
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
:Detour
0001: wait 0
0AB1: call @DamageConvert 0 return_to 13@
0AB1: call @GiveTakeDamageRPC 3 0@ 13@ 1@
0AB2: ret 0
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
:SEND_ONFOOT_PACKET
0001: wait 0
00A0: store_actor 0@ position_to 1@ 2@ 3@
0604: get_Z_angle_for_point 1@ 2@ store_to 17@
0B2B: samp 8@ = get_player_id_by_actor_handle $PLAYER_ACTOR
0AC8: 4@ = allocate_memory_size 68
0BBA: samp store_player 8@ onfoot_data 4@
0C0D: struct 4@ offset 30 size 4 = 17@
0B40: raknet bit_stream 5@ write PACKET_PLAYER_SYNC type BS_TYPE_BYTE size 1
0B40: raknet bit_stream 5@ write 4@ type BS_TYPE_ARRAY size 68
0B8B: raknet send bit_stream 5@
0B3E: raknet delete_bit_stream 5@
0AC9: free_allocated_memory 4@
0AB2: ret 0
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
:SendSilentBullet
0001: wait 0
0470: 3@ = actor $PLAYER_ACTOR current_weapon
00A0: store_actor $PLAYER_ACTOR position_to 4@ 5@ 6@
0B2B: samp 8@ = get_player_id_by_actor_handle 0@
00A0: store_actor 0@ position_to 9@ 10@ 11@
0AC8: 2@ = allocate_memory_size 40
0C0D: struct 2@ offset 0 size 1 = 1
0C0D: struct 2@ offset 1 size 2 = 8@
0C0D: struct 2@ offset 3 size 4 = 4@
0C0D: struct 2@ offset 7 size 4 = 5@
0C0D: struct 2@ offset 11 size 4 = 6@
0098: 22@ = random_float 0.0 _to_ 0.2
0209: 21@ = random_int_in_ranges 0 1
if 21@ == 1
then 005B: 9@ += 22@
else 005B: 9@ -= 22@
end
0098: 22@ = random_float 0.0 _to_ 0.2
0209: 21@ = random_int_in_ranges 0 1
if 21@ == 1
then 005B: 10@ += 22@
else 005B: 10@ -= 22@
end
0098: 22@ = random_float 0.0 _to_ 0.2
0209: 21@ = random_int_in_ranges 0 1
if 21@ == 1
then 005B: 1@ += 22@
else 005B: 1@ -= 22@
end
0C0D: struct 2@ offset 15 size 4 = 9@
0C0D: struct 2@ offset 19 size 4 = 10@
0C0D: struct 2@ offset 23 size 4 = 11@
0098: 22@ = random_float 0.0 _to_ 0.2
0098: 23@ = random_float 0.0 _to_ 0.2
0098: 24@ = random_float 0.0 _to_ 0.2
0C0D: struct 2@ offset 27 size 4 = 22@
0C0D: struct 2@ offset 31 size 4 = 23@
0C0D: struct 2@ offset 35 size 4 = 24@
0C0D: struct 2@ offset 39 size 1 = 3@
0B3D: raknet 12@ = new_bit_stream
0B40: raknet bit_stream 12@ write 206 type BS_TYPE_BYTE size 1
0B40: raknet bit_stream 12@ write 2@ type BS_TYPE_ARRAY size 40
0B8B: raknet send bit_stream 12@
0B3E: raknet delete_bit_stream 12@
0AC9: free_allocated_memory 2@
0AB2: ret 2 8@ 3@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
:ColorFilter
0001: wait 0
if 0@ == 1
then
0B2B: samp 22@ = get_player_id_by_actor_handle 1@
0B2B: samp 21@ = get_player_id_by_actor_handle $PLAYER_ACTOR
0B37: samp 20@ = get_player_color 22@
0B37: samp 19@ = get_player_color 21@
if 0085: 20@ == 19@
then 18@ = 1
end
end
if and
0@ == 1
18@ == 0
then 17@ = 1
end
if 0@ == 0
then 17@ = 1
end
//alloc 15@ 67
//format 15@ "Enemy: %d | My: %d | Identity: %d | True: %d" 20@ 19@ 18@ 17@
//chatmsg 15@ 0xFFFFFF
//free 15@
0AB2: ret 1 17@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
:PACKET_SYNC_HOOK
0001: wait 0
0BE5: raknet 2@ = get_hook_param PARAM_BITSTREAM
0BE5: raknet 3@ = get_hook_param PARAM_PACKETID
if 3@ == PACKET_BULLET_SYNC
then
if 30@ == 1
then
0AB1: @GET_AIM_TARGET_ACTOR 1 IN_RADIUS_FROM_CROSSHAIR 29@ _STORE_TO 7@
if 7@ <> -1
then
0AB1: call @ColorFilter 2 23@ 7@ 17@
if 17@ == 1
then
if 27@ == 1
then
if 26@ == 1
then 0AB1: call @SEND_ONFOOT_PACKET 1 7@
end
end
if 24@ == 0
then 0AB1: call @SendSilentBullet 1 7@ ret_to 0@ 1@
else
0209: 31@ = random_int_in_ranges 0 10
if 002D: 31@ >= 24@
then 0AB1: call @SendSilentBullet 1 7@ ret_to 0@ 1@
end
end
if 27@ == 1
then
if 25@ == 1
then 0AB1: call @Detour 2 0@ 1@
end
end
0BE0: raknet hook_ret false
end
end
end
end
0BE0: raknet hook_ret true
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
:GET_AIM_TARGET_ACTOR
0001: wait 0
FOR 28@ = 0.0 TO 0@ STEP 8.0
0A8D: 29@ = read_memory 0xB74490 size 4 virtual_protect 0
000A: 29@ += 0x4
0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
for 30@ = 0 to 35584 step 0x100
0A8D: 31@ = read_memory 29@ size 1 virtual_protect 0
000A: 29@ += 0x1
if and
0029: 31@ >= 0x00
001B: 0x80 > 31@
then
005A: 31@ += 30@
if
056D: actor 31@ defined
then
if
803C: $PLAYER_ACTOR == 31@
then
04C4: store_coords_to 27@ 26@ 25@ from_actor 31@ with_offset 0.0 0.0 0.0
068D: get_camera_position_to 24@ 23@ 22@
if and
06BD: no_obstacles_between 27@ 26@ 25@ and 24@ 23@ 22@ solid 1 car 1 actor 0 object 1 particle 0
80DF: actor 31@ driving
8118: actor 31@ dead
02CB: actor 31@ bounding_sphere_visible
then
04C4: store_coords_to 10@ 11@ 12@ from_actor 31@ 0.0 0.0 0.0
0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 10@ Y 11@ Z 12@ store_screen_X_to 13@ Y_to 14@
0509: 15@ = distance_between_XY 339.1 179.1 and_XY 13@ 14@
if
0035: 28@ >= 15@
then
0AB2: 1 31@
end
end
end
end
end
end
END
0AB2: 1 -1
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
:Configuration
0001: wait 0
if 0AAB: file_exists "CLEO\cfg.ini"
then
0AF0: 28@ = get_int_from_ini_file "CLEO\cfg.ini" section "Settings" key "TargetHookDistance"
0AF0: 27@ = get_int_from_ini_file "CLEO\cfg.ini" section "Settings" key "Detour"
0AF0: 26@ = get_int_from_ini_file "CLEO\cfg.ini" section "Settings" key "QuatCorrector"
0AF0: 25@ = get_int_from_ini_file "CLEO\cfg.ini" section "Settings" key "GiveDamageRPC"
0AF0: 24@ = get_int_from_ini_file "CLEO\cfg.ini" section "Settings" key "RandomShot"
0AF0: 23@ = get_int_from_ini_file "CLEO\cfg.ini" section "Settings" key "FriendlyFire"
0093: 29@ = integer 28@ to_float
else
0AF1: write_int 40 to_ini_file "CLEO\cfg.ini" section "Settings" key "TargetHookDistance"
0AF1: write_int 1 to_ini_file "CLEO\cfg.ini" section "Settings" key "Detour"
0AF1: write_int 1 to_ini_file "CLEO\cfg.ini" section "Settings" key "QuatCorrector"
0AF1: write_int 1 to_ini_file "CLEO\cfg.ini" section "Settings" key "GiveDamageRPC"
0AF1: write_int 0 to_ini_file "CLEO\cfg.ini" section "Settings" key "RandomShot"
0AF1: write_int 0 to_ini_file "CLEO\cfg.ini" section "Settings" key "FriendlyFire"
29@ = 40.0
27@ = 1
26@ = 1
25@ = 1
24@ = 0
23@ = 0
end
0AB2: ret 6 29@ 27@ 26@ 25@ 24@ 23@
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
:getScreenXYFrom3DCoords
0001: wait 0
0AC7: 14@ = var 0@ offset
0AC7: 15@ = var 3@ offset
0AC7: 16@ = var 6@ offset
0AC7: 17@ = var 9@ offset
0AA5: call 0x70CE30 num_params 6 pop 6 {18@ 18@} 0 0 17@ 16@ 15@ 14@
0007: 12@ = 640.0
0007: 13@ = 448.0
0A8D: 14@ = read_memory 0xC17044 size 4 virtual_protect 0
0A8D: 15@ = read_memory 0xC17048 size 4 virtual_protect 0
0093: 14@ = integer 14@ to_float
0093: 15@ = integer 15@ to_float
0073: 12@ /= 14@
0073: 13@ /= 15@
006B: 3@ *= 12@
006B: 4@ *= 13@
0AB2: ret 2 3@ 4@
/////////////////////////////////// Happy End ! ////////////////////////////////////////////////////////////////////////////////////////////////
Нужно сделать в нем:
1) Автоматическую активацию при входе в игру без ввода команды.
2) При вводе /aimcfg ничего в чат не выводилось
P.S. Я рак просто нихера не соображающий.