Шурик
Активный
- 216
- 43
Прошу помочь с адаптацией данного кода на SAMPFUNCS (C++):
CLEO:
{$CLEO .cs}
//-------------MAIN---------------
thread "map"
0000: NOP
wait 2000
if
0AAB: file_exists "CLEO\map.ini"
else_jump @Label0000A3
0AF4: 4@v = read_string_from_ini_file "cleo\map.ini" section "MAP" key "file"
0AF0: 28@ = get_int_from_ini_file "cleo\map.ini" section "MAP" key "key"
0AF0: 29@ = get_int_from_ini_file "cleo\map.ini" section "MAP" key "alpha"
0AF0: 27@ = get_int_from_ini_file "cleo\map.ini" section "MAP" key "toggle"
:Label0000A3
0390: load_txd_dictionary "MAP"
038F: load_texture 4@v as 1 // Load dictionary with 0390 first
038F: load_texture "pla" as 2 // Load dictionary with 0390 first
038F: load_texture "MAR" as 3 // Load dictionary with 0390 first
:Label0000C3
wait 0
call @Label0005AC 1 0
if and
27@ == 1
key_down 28@
else_jump @Label000117
call @Label000462 0 30@
if
30@ == 0
else_jump @Label000117
0B12: 31@ = 31@ XOR 1
wait 100
:Label000117
if and
31@ == 1
27@ == 1
else_jump @Label000149
call @Label0005AC 1 1
call @Label00019F 1 29@
:Label000149
if and
27@ == 0
key_down 28@
else_jump @Label000198
call @Label000462 0 30@
if
30@ == 0
else_jump @Label000198
call @Label0005AC 1 1
call @Label00019F 1 29@
:Label000198
jump @Label0000C3
:Label00019F
03F0: enable_text_draw 1
03E3: set_texture_to_be_drawn_antialiased 1
038D: draw_texture 1 position 320.0 224.0 size 448.0 448.0 RGBA 255 255 255 0@
call @Label0002C5 0 23@ 24@ 25@
if and
not 23@ == 0.0
not 24@ == 0.0
else_jump @Label000204
gosub @Label0003A3
:Label000204
0A8D: 30@ = read_memory 13098730 size 1 virtual_protect 0
if
30@ == 1
else_jump @Label00025D
call @Label0004B5 0 23@ 24@ 25@
if and
not 23@ == 0.0
not 24@ == 0.0
else_jump @Label00025D
gosub @Label0003A3
:Label00025D
Actor.StorePos($PLAYER_ACTOR, 1@, 2@, 3@)
3@ = Actor.Angle($PLAYER_ACTOR)
3@ -= 180.0
3@ *= -1.0
0@ = 2
gosub @Label00040C
if
0AB6: store_target_marker_coords_to 1@ 2@ 3@ // IF and SET
else_jump @Label0002C0
0@ = 3
3@ = 0
gosub @Label00040C
:Label0002C0
ret 0
:Label0002C5
12@ = 9999.0
0@ = 0
:Label0002D6
0085: 1@ = 0@ // (int)
1@ *= 56
1@ += 13103448
1@ += 16
0A8D: 2@ = read_memory 1@ size 4 virtual_protect 0
1@ += 4
0A8D: 3@ = read_memory 1@ size 4 virtual_protect 0
1@ += 4
0A8D: 4@ = read_memory 1@ size 4 virtual_protect 0
Actor.StorePos($PLAYER_ACTOR, 5@, 6@, 7@)
050A: 8@ = distance_between_XYZ 2@ 3@ 4@ and_XYZ 5@ 6@ 7@
if
0025: 12@ > 8@ // (float)
else_jump @Label000380
0087: 12@ = 8@ // (float)
0087: 9@ = 2@ // (float)
0087: 10@ = 3@ // (float)
0087: 11@ = 4@ // (float)
:Label000380
0@ += 1
0@ > 31
else_jump @Label0002D6
ret 3 9@ 10@ 11@
:Label0003A3
23@ /= 13.4
23@ += 320.0
24@ /= -13.4
24@ += 224.0
03F0: enable_text_draw 1
03E3: set_texture_to_be_drawn_antialiased 1
038E: draw_box_position 23@ 24@ size 6.0 6.0 RGBA 0 0 0 255
038E: draw_box_position 23@ 24@ size 5.0 5.0 RGBA 255 0 0 255
return
:Label00040C
1@ /= 13.4
1@ += 320.0
2@ /= -13.4
2@ += 224.0
03F0: enable_text_draw 0
03E3: set_texture_to_be_drawn_antialiased 1
074B: draw_texture 0@ position 1@ 2@ scale 10.0 10.0 angle 3@ color_RGBA 255 255 255 255
return
:Label000462
0AA2: 1@ = load_library "samp.dll" // IF and SET
1@ += 2203880
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
1@ += 8
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
1@ += 4
0A8D: 1@ = read_memory 1@ size 1 virtual_protect 0
ret 1 1@
:Label0004B5
10@ = 13098328
6@ = 0
:Label0004C6
0085: 14@ = 6@ // (int)
14@ *= 160
0A8E: 13@ = 10@ + 14@ // int
0A8E: 11@ = 13@ + 48 // int
0A8D: 3@ = read_memory 11@ size 4 virtual_protect 0
0A8E: 11@ = 13@ + 52 // int
0A8D: 4@ = read_memory 11@ size 4 virtual_protect 0
0A8E: 11@ = 13@ + 56 // int
0A8D: 5@ = read_memory 11@ size 4 virtual_protect 0
if and
not 3@ == 0.0
not 4@ == 0.0
else_jump @Label000589
if or
3@ == 1099.551
4@ == 1601.497
5@ == 11.44687
3@ == 2695.624
4@ == -1704.688
5@ == 10.844
else_jump @Label00059E
:Label000589
6@ += 1
6@ > 32
else_jump @Label0004C6
:Label00059E
ret 3 3@ 4@ 5@
:Label0005AC
0AA2: 1@ = load_library "samp.dll" // IF and SET
1@ += 2203876
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
1@ += 8
if
0@ == 1
else_jump @Label0005FC
0A8C: write_memory 1@ size 4 value 0 virtual_protect 1
jump @Label000607
:Label0005FC
0A8C: write_memory 1@ size 4 value 2 virtual_protect 1
:Label000607
ret 0