Другое Полезные сниппеты и SCM-функции

Opcode.eXe

Известный
84
112
Does anyone know, how to make CLEO.cs mods run in their own thread?

Example:
0AB1: @MAKE_BEEP 2 FREQUENCY 0x25 TIME_MS 5000
-> Will make GTA_SA.EXE stop working for 5 seconds.

or

0AB1: @URLDownloadToFile 2 "file.txt" "google.com"
-> GTA_SA.EXE paused until download is finished.

I need to make my .cs multithreaded. So does anyone know how?
( maybe impossible?)
 

Opcode.eXe

Известный
84
112
This function will say the TEXT with a voice. You can set the language of the Voice too.

Function:
0AC8: 0@ = allocate_memory_size 260
0AC8: 1@ = allocate_memory_size 260
0AD3: 0@ = "Hello this is an TEXT to VOICE"
0AD3: 1@ = "en" // "de" - German, "ru" - russian" more on google ^^
0AB1: @VOICE_SAY_TEXT 2 0@ LANGUAGE 1@
0AC9: free_allocated_memory 0@
0AC9: free_allocated_memory 1@

Код:
//0AB1: @VOICE_SAY_TEXT 2 0@ LANGUAGE 1@
:VOICE_SAY_TEXT
IF
0AAB:  file_exists "CLEO\downloads\voice.mp3"
THEN
    0B00: delete_file "CLEO\downloads\voice.mp3"
END     
0AC8: 2@ = allocate_memory_size 260
0ad3: 2@ = "http:%c%ctranslate.google.com/translate_tts?tl=%s&q=%s" 47 47 1@ 0@
0D92: 3@ = download_query url 2@ local_file "voice.mp3"
REPEAT
    WAIT 0     
    0D93: download_query 3@ get_state_to 4@ 
UNTIL 4@ == 0
0AAC: 4@ = load_audiostream "CLEO\downloads\voice.mp3"
0AAD: set_mp3 4@ perform_action 1
0AC0: audiostream 4@ loop 0
0ABC: set_audiostream 4@ volume 1.0
REPEAT
WAIT 0 // by OpcodeXe
    0AB9: get_audio_stream_state 4@ store_to 5@
UNTIL 5@ == -1
0AAE: release_mp3 4@
0AC9: free_allocated_memory 2@
0AB2: 0

Example:
- Read CHAT when pressing R.


Код:
{$CLEO .cs}
0000:

REPEAT
    WAIT 0
UNTIL 0AFA:  SAMP_IS_READY

WHILE TRUE
    WAIT 0
    IF
    0AB0: 82
    THEN
        0AC8: 0@ = allocate_memory_size 260
        0AC8: 1@ = allocate_memory_size 260
        0AB1: @GETCHATENTRYTEXT 1 ID 99 0@
        0AD3: 1@ = "en"
        0AB1: @VOICE_SAY_TEXT 2 0@ LANGUAGE 1@ 
        0AC9: free_allocated_memory 0@
        0AC9: free_allocated_memory 1@
    END
END

:getChatEntryText
0AF7: samp 1@ = get_base
1@ += 0x212A6C
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
1@ += 0x136
0@ *= 0xFC
005A: 1@ += 0@
1@ += 0x1C
0AB2: 1 1@

//0AB1: @VOICE_SAY_TEXT 2 0@ LANGUAGE 1@
:VOICE_SAY_TEXT
IF
0AAB:  file_exists "CLEO\downloads\voice.mp3"
THEN
    0B00: delete_file "CLEO\downloads\voice.mp3"
END     
0AC8: 2@ = allocate_memory_size 260
0ad3: 2@ = "http:%c%ctranslate.google.com/translate_tts?tl=%s&q=%s" 47 47 1@ 0@
0D92: 3@ = download_query url 2@ local_file "voice.mp3"
REPEAT
    WAIT 0     
    0D93: download_query 3@ get_state_to 4@ 
UNTIL 4@ == 0
0AAC: 4@ = load_audiostream "CLEO\downloads\voice.mp3"
0AAD: set_mp3 4@ perform_action 1
0AC0: audiostream 4@ loop 0
0ABC: set_audiostream 4@ volume 1.0
REPEAT
WAIT 0 // by OpcodeXe
    0AB9: get_audio_stream_state 4@ store_to 5@
UNTIL 5@ == -1
0AAE: release_mp3 4@
0AC9: free_allocated_memory 2@
0AB2: 0
 

gcode

нестандартное звание звание звание звание звани...
Друг
789
357
Замена встроенного опкода ходьбы (применяется в Botter). Цикл можно вынести за пределы функции, чтобы сделать её прерываемой.

CLEO:
0AB1: call @char_goto 4 XYZ 1234.0 4321.0 1243.0 sprint true
 
:char_goto
repeat
    wait 0
    00A0: store_actor $PLAYER_ACTOR position_to 4@ 5@ 2@
    0063: 0@ -= 4@
    0063: 1@ -= 5@
    0604: get_Z_angle_for_point 0@ 1@ store_to 2@
    005B: 0@ += 4@
    005B: 1@ += 5@
    2@ *= 0.01745
    0A96: 4@ = actor $PLAYER_ACTOR struct
    4@ += 0x558
    0A8C: write_memory 4@ size 4 value 2@ virtual_protect 0
    0373: set_camera_directly_behind_player
    if
        3@ == false
    then
        4@ = 0xB73458
        4@ += 0x20
        0A8C: write_memory 4@ size 1 value 0 virtual_protect 0
        4@ = 0xB73458
        4@ += 0x3
        0A8C: write_memory 4@ size 1 value 255 virtual_protect 0
    else
        4@ = 0xB73458
        4@ += 0x20
        0A8C: write_memory 4@ size 1 value 255 virtual_protect 0
        4@ = 0xB73458
        4@ += 0x3
        0A8C: write_memory 4@ size 1 value 255 virtual_protect 0
    end
until 00ED: actor $PLAYER_ACTOR 0 near_point 0@ 1@ radius 0.4 0.4 on_foot
0AB2: ret 0
 

itsLegend

Фонд борьбы за жуков 🐞
Администратор
2,696
1,468
Описание:
Возвращает дистанцию и ид ближайшего игрока.​

Код:
CLEO:
:get_id_nearest_player
// FOR ALL PEDS
3@ = 1000.0 // Max. distance
4@ = 0xFFFFFF // Nearest player handle / id
 
0A8D: 0@ = read_memory 0xB74490 size 4 virtual_protect 0
0@ += 4
0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0
for 1@ = 0 to 35584 step 0x100
    0A8D: 2@ = read_memory 0@ size 1 virtual_protect 0
    0@++
    if and
        2@ >= 0x00
        2@ < 0x80
    then
        005A: 2@ += 1@
        if or
            003C: $PLAYER_ACTOR == 2@ // LOCAL_PLAYER == REMOTE_PLAYER
            856D: NOT actor 2@ defined // REMOTE PLAYER IS NOT DEFINED
        then continue
        end
    
        0AB1: call @distanceBetweenActor 1 remote_player_handle 2@ retr_dist_to 5@
        if 0025: 3@ > 5@ // Max. dist > cur.
        then
            0087: 3@ = 5@ // Max. dist = cur.
            0085: 4@ = 2@ // Save remote player handle
        end
    end
end
 
if 4@ = SAMP.GetSAMPPlayerIDByActorHandle(4@)
then
    0485:  return_true
else
    059A:  return_false
end
0AB2: ret 2 3@ 4@
 
:distanceBetweenActor
Actor.StorePos(0@, 1@, 2@, 3@)
Actor.StorePos($PLAYER_ACTOR, 4@, 5@, 6@)
050A: 7@ = distance_between_XYZ 4@ 5@ 6@ and_XYZ 1@ 2@ 3@
0AB2: ret 1 7@

Использование:
CLEO:
{$CLEO}
 
0001: wait 0 ms
0662: "by legend2360"
0662: "BlastHack - cheating is art"
 
while not SAMP.Available()
    wait 400
end
 
while true
    wait 0
    if 0AB1: call @get_id_nearest_player 0 retr_to fdist 0@ sid 1@
    then
        0AD1: show_formatted_text_highpriority "Player %d ; dist %.2f" 0 1@ 0@
    end
end

UPD 24.11: Перезаписал функу, лучше так, чем через пул сампа :)
 

SR_team

like pancake
BH Team
4,803
6,475
Пемещение диалогов как окон windows
CLEO:
:DialogMove
{Example:
0ab1: call @DialogMove 2 dialogID 0@ keyMoveID 1@
in: 0@ - dialog id for move; 1@ - key id for move
out: none}
0085: 9@ = 1@
0B85: dialog 0@ get_position_to 1@ 2@ size_to 3@ 4@
if 0ab1: call @TaskDialog 4 1@ 2@ 3@ 9@ ret_offset 7@ 8@
    then
    repeat
    wait 0
    0B5E: get_cursor_pos 5@ 6@
    0062: 5@ -= 7@
    0062: 6@ -= 8@
    0B84: dialog 0@ set_pos_XY 5@ 6@ size 3@ 4@
    until 8ab0: 9@
    0BA1: dialog 0@ set_minimized 0
    end
ret 0
:TaskDialog
0085: 6@ = 3@
0085: 4@ = 0@
0085: 5@ = 1@
005A: 4@ += 2@
5@ += 15
0B5E: get_cursor_pos 2@ 3@
if and
0ab0: 6@
002D: 2@ >= 0@
801D: 2@ <= 4@
002D: 3@ >= 1@
801D: 3@ <= 5@
    then
    0485:  return_true
    0062: 2@ -= 0@
    0062: 3@ -= 1@
    else
    059A:  return_false
    2@ = -1
    3@ = -1
    end
ret 2 2@ 3@[/PHP]
[SPOILER="без возможности переместить диалог за приделы экрана"]
[PHP]:DialogMove
{Example:
0ab1: call @DialogMove 2 dialogID 0@ keyMoveID 1@
in: 0@ - dialog id for move; 1@ - key id for move
out: none}
0085: 9@ = 1@
0B85: dialog 0@ get_position_to 1@ 2@ size_to 3@ 4@
if 0ab1: call @TaskDialog 4 1@ 2@ 3@ 9@ ret_offset 7@ 8@
    then
    repeat
    wait 0
    0B5E: get_cursor_pos 5@ 6@
    0062: 5@ -= 7@
    0062: 6@ -= 8@
    0B84: dialog 0@ set_pos_XY 5@ 6@ size 3@ 4@
    call @DialogBorder 1 dialogID 0@
    until 8ab0: 9@
    0BA1: dialog 0@ set_minimized 0
end
ret 0
:TaskDialog
0085: 6@ = 3@
0085: 4@ = 0@
0085: 5@ = 1@
005A: 4@ += 2@
5@ += 15
0B5E: get_cursor_pos 2@ 3@
if and
0ab0: 6@
002D: 2@ >= 0@
801D: 2@ <= 4@
002D: 3@ >= 1@
801D: 3@ <= 5@
    then
    0485: return_true
    0062: 2@ -= 0@
    0062: 3@ -= 1@
    else
    059A: return_false
    2@ = -1
    3@ = -1
    end
ret 2 2@ 3@
:DialogBorder
0B85: dialog 0@ get_position_to 1@ 2@ size_to 3@ 4@
0B5A: get_screen_resolution 5@ 6@
0062: 5@ -= 3@
0062: 6@ -= 4@
if 1@ < 0
    then 1@ = 0
    end
if 2@ < 0
    then 2@ = 0
    end
if 001D: 1@ > 5@
    then 0085: 1@ = 5@
    end
if 001D: 2@ > 6@
    then 0085: 2@ = 6@
    end
0B84: dialog 0@ set_pos_XY 1@ 2@ size 3@ 4@
ret 0
[/SPOILER]
 

Opcode.eXe

Известный
84
112
Function:
0AB1: @POSITION_TO_RADAR 7 XYZ 0.0 0.0 0.0 RADAR_POS 400 400 DISTANCE_MULTIPLIER 1.5 MAX_DISTANCE 300.0 _STORE_TO 1@ 2@

This function converts 3D position to 2D Radar position like on the Minimap.
You can make things like this:
http://i.san-mp.de/i/26CEA9.webm
Source:
Код:
{$CLEO .cs}
0000:
REPEAT
    WAIT 0
UNTIL 0AFA:  SAMP_IS_READY
0B6D: 5@ = create_font "Arial" height 10 flags 0x4
0BFC: SET_VAR "MadeByOpcodeXe" = 5@
 
 
WHILE TRUE
    WAIT 0 
    FOR 31@ = 0 TO 1000
        IF
        0B23:  samp is_player_connected 31@
        THEN
            IF
            0B20: samp 30@ = actor_handle_by_samp_player_id 31@
            THEN
                0AB1: @GET_BONE_POS 2 FROM_ACTOR $PLAYER_ACTOR BONE 6 _STORE_TO 5@ 6@ 7@  // HEAD 
                04C4: store_coords_to 8@ 9@ 10@ from_actor 30@ with_offset 0.0 0.0 0.0                   
                0B55: convert_3D_coords 5@ 6@ 7@ to_screen 5@ 6@
                0AB1: @POSITION_TO_RADAR 7 XYZ 8@ 9@ 10@ RADAR_POS 5@ 6@ DISTANCE_MULTIPLIER 1.5 MAX_DISTANCE 300.0 _STORE_TO 13@ 14@
                0B70: draw_polygon_pos 5@ 6@ size 7 7 corners 7 rotation 0 color 0xFFFFFFFF
                0B70: draw_polygon_pos 13@ 14@ size 5 5 corners 5 rotation 90 color 0xFFFFFFFF                                     
                0B36: samp 15@ = get_player_nickname 31@
                0B37: samp 16@ = get_player_color 31@
                0BFD: 5@ = get_global_var "MadeByOpcodeXe"
                0B6B: 6@ = font 5@ draw_text 15@ length
                0B6C: 7@ = font 5@ draw_height
                7@ += 5
                6@ /= 2
                0062: 13@ -= 6@  // (int)
                0062: 14@ -= 7@  // (int)
                0B6F: render font 5@ draw_text 15@ pos 13@ 14@ color 16@
            END
        END
    END 
END   
 
//0AB1: @GET_BONE_POS 2 FROM_ACTOR $PLAYER_ACTOR BONE 6 _STORE_TO 1@ 2@ 3@  // HEAD   
:GET_BONE_POS
0085: 10@ = 0@ // (int)
0085: 15@ = 1@ // (int)
1@ = 0.0 // X offset
2@ = 0.0 // Y offset {THX TO: WESSER}
3@ = 0.0 // Z offset
0A96: 0@ = actor 10@ struct
0AC7: 4@ = var 1@ offset
0AA6: call_method 0x5E01C0 struct 0@ num_params 3 pop 0 bIncludeAnim 1 iBoneID 15@ vOffset 4@ // CPed__getBonePositionWithOffset
0AB2: retn 3 1@ 2@ 3@
//0AB1: @POSITION_TO_RADAR 7 XYZ 0.0 0.0 0.0 RADAR_POS 400 400 DISTANCE_MULTIPLIER 1.5 MAX_DISTANCE 300.0 _STORE_TO 1@ 2@ 
:POSITION_TO_RADAR
04C4: 10@ 11@ 12@ = XYZ $PLAYER_ACTOR 0.0 0.0 0.0
050A: 13@ = distance_between_XYZ 0@ 1@ 2@ and_XYZ 10@ 11@ 12@
006B: 13@ *= 5@
IF
0025:  13@ > 6@
THEN
0087: 13@ = 6@ // (float)
END 
0AB1: @getZAngleBetweenPoints 4 from_XY 10@ 11@ and_XY 0@ 1@ store_to 14@ 
14@ *= -1.0
0AB1: @getCameraFacingAngle 0 15@
005B: 14@ += 15@
0093: 3@ = integer 3@ to_float
0093: 4@ = integer 4@ to_float
0AB1: @makeCordinate 6 3@ 4@ 0.0 Z_Angle 14@ 0.0 Distance 13@ STORE_TO 16@ 17@
0092: 16@ = float 16@ to_integer
0092: 17@ = float 17@ to_integer
0AB2: 2 16@ 17@
:makeCordinate
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: 2 0@ 1@
:getCameraFacingAngle
00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@ 
0AA6: call_method 0x514970 struct 0xB6F028 num_params 6 pop 0 0xA49994 0xA499A0 3@ 2@ 1@ 20.0
0AB1: call_scm_func @getZAngleBetweenPoints 4 from_XY $13 $14 and_XY 1@ 2@ store_to 4@
0AB2: 1 4@
:getZAngleBetweenPoints
0063: 0@ -= 2@
0063: 1@ -= 3@
0604: get_Z_angle_for_point 0@ 1@ store_to 4@
0AB2: 1 4@

Function code:
Код:
//0AB1: @POSITION_TO_RADAR 7 XYZ 0.0 0.0 0.0 RADAR_POS 400 400 DISTANCE_MULTIPLIER 1.5 MAX_DISTANCE 300.0 _STORE_TO 1@ 2@ 
:POSITION_TO_RADAR
04C4: 10@ 11@ 12@ = XYZ $PLAYER_ACTOR 0.0 0.0 0.0
050A: 13@ = distance_between_XYZ 0@ 1@ 2@ and_XYZ 10@ 11@ 12@
006B: 13@ *= 5@
IF
0025:  13@ > 6@
THEN
0087: 13@ = 6@ // (float)
END 
0AB1: @getZAngleBetweenPoints 4 from_XY 10@ 11@ and_XY 0@ 1@ store_to 14@ 
14@ *= -1.0
0AB1: @getCameraFacingAngle 0 15@
005B: 14@ += 15@
0093: 3@ = integer 3@ to_float
0093: 4@ = integer 4@ to_float
0AB1: @makeCordinate 6 3@ 4@ 0.0 Z_Angle 14@ 0.0 Distance 13@ STORE_TO 16@ 17@
0092: 16@ = float 16@ to_integer
0092: 17@ = float 17@ to_integer
0AB2: 2 16@ 17@
:makeCordinate
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: 2 0@ 1@
:getCameraFacingAngle
00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@ 
0AA6: call_method 0x514970 struct 0xB6F028 num_params 6 pop 0 0xA49994 0xA499A0 3@ 2@ 1@ 20.0
0AB1: call_scm_func @getZAngleBetweenPoints 4 from_XY $13 $14 and_XY 1@ 2@ store_to 4@
0AB2: 1 4@
:getZAngleBetweenPoints
0063: 0@ -= 2@
0063: 1@ -= 3@
0604: get_Z_angle_for_point 0@ 1@ store_to 4@
0AB2: 1 4@
 
  • Нравится
Реакции: ehxqu, AWRage и XyJluraH_J

itsLegend

Фонд борьбы за жуков 🐞
Администратор
2,696
1,468
Описание:
Ищет в зоне стрима пикап с указанной моделью, при существовании данного пикапа - возвращает его ид.​

Код:
Код:
:getPickupIdByModel
0BB9: samp 1@ = get_pickup_pool_ptr
0A8D: 2@ = read_memory 1@ size 4 virtual_protect 0 // PickupsCount
if 2@ > 0
then
    0A8E: 2@ = 1@ + 0x4 // ul_GTA_PickupID
    0A8E: 3@ = 1@ + 0xF004 // stPickup
    for 4@ = 0 to 4095 step 1
        0A90: 5@ = 4@ * 4
        005A: 5@ += 2@
        0A8D: 5@ = read_memory 5@ size 4 virtual_protect 0
        if 5@ <> 0
        then
            0A90: 5@ = 4@ * 20
            005A: 5@ += 3@
            0A8D: 5@ = read_memory 5@ size 4 virtual_protect 0 // pickupModel
            if 003b: 5@ == 0@
            then
                0485:  return_true
                0AB2: ret 1 4@
            end
        end
    end
end
059A:  return_false
0AB2: ret 1 -1

Использование:
Код:
{$CLEO}
 
0001: wait 0 ms
 
while not SAMP.Available()
    wait 400
end
 
0B34: samp register_client_command "gidpick" to_label @cmd
 
0BDE: pause_thread 0
 
:cmd
0B35: samp 0@ = get_last_command_params
0C1A: 1@ = atoi 0@
if 0AB1: call_scm_func @getPickupIdByModel 1 model 1@ id_to 2@
then
    0AF8: samp add_message_to_chat "PickupID %d, model %d" color -1 params 2@ 1@
end
0B43: samp cmd_ret
 

SR_team

like pancake
BH Team
4,803
6,475
Получение разрешения экрана:
Код:
call @GetResolution 0 1@ 2@
:GetResolution
0A8D: 0@ = read_memory 0xC9C040 size 4 virtual_protect 0 //X
0A8D: 1@ = read_memory 0xC9C044 size 4 virtual_protect 0 //Y
ret 2 0@ 1@
Получение диагонали экрана:
Код:
call @DisplayInch 0 1@
:DisplayInch
0A8D: 0@ = read_memory 0xC9C048 size 4 virtual_protect 0
ret 1 0@
Получение частоты обновления экрана в Mhz:
Код:
call @DisplayRefresh 0 1@
:DisplayRefresh
0A8D: 0@ = read_memory 0xC9C070 size 4 virtual_protect 0
ret 1 0@
Проверка, что запущена игра в окне:
Код:
call @isWindowMode 0
:isWindowMode
0A8D: 0@ = read_memory 0xC9C060 size 4 virtual_protect 0
if 0@ == 1
    then ret 0 1
end
ret 0 0
 
Последнее редактирование:

DubStep_

Известный
292
52
Установка позиции курсора

Код:
call @CursorSetPos 2 X: 200 Y: 240

:CursorSetPos           
{ ex: call @CursorSetPos 2 200 240 }                    
0AA2: 2@ = load_library "user32.dll"  
0AA4: 3@ = get_proc_address "SetCursorPos" library 2@  
0AA5: call 3@ num_params 2 pop 0 1@ 0@ 
ret 0
 
  • Нравится
Реакции: Избранный

SR_team

like pancake
BH Team
4,803
6,475
Расширяем количество переменных, ну или что-то в этом роде.
В доп. памяти можно хранить int, float, указатели. Строки хранить нельзя, если хотите хранить строки, то нужно увеличить размер каждой ячейки буфера (00 00 00 00 00) и изменить множитель. Сейчас множитель 5, он определяется числом байт 1 ячейки (00 - байт). Размер 1 переменной 4 байта, по этому в буфере каждая ячейка записана в 5 байт, что бы было разделение между ними.
Число ячеек можно увеличить до бесконечности.

Что бы сохранить переменную юзайте 0ab1: @sVar 2 _bufVar _fromVar, где _bufVar это ячейка в буфере, а _fromVar та переменная которую надо сохранить.
Что бы загрузить переменную юзайте 0ab1: @gVar 1 _bufVar _toVar, где _bufVar так же ячейка в буфере, а _toVar переменная в которую надо загрузить инфу из буфера.
Код:
:sVar
//0ab1: @sVar 2 _bufVar _fromVar
0AC6: 2@ = label @Buffer offset
0@ *= 5
005A: 2@ += 0@ // (int)
0A8C: write_memory 2@ size 4 value 1@ virtual_protect 1
ret 0  
:gVar
//0ab1: @gVar 1 _bufVar _toVar
0AC6: 1@ = label @Buffer offset
0@ *= 5
005A: 1@ += 0@ // (int)
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 1
ret 1 1@
:Buffer
hex
00 00 00 00 00 //0
00 00 00 00 00 //1
00 00 00 00 00 //2
00 00 00 00 00 //3
00 00 00 00 00 //4
00 00 00 00 00 //5
00 00 00 00 00 //6
00 00 00 00 00 //7
00 00 00 00 00 //8
00 00 00 00 00 //9
00 00 00 00 00 //11
00 00 00 00 00 //12
00 00 00 00 00 //13
00 00 00 00 00 //14
00 00 00 00 00 //15
00 00 00 00 00 //16
00 00 00 00 00 //17
00 00 00 00 00 //18
00 00 00 00 00 //19
00 00 00 00 00 //20
00 00 00 00 00 //21
00 00 00 00 00 //22
00 00 00 00 00 //23
00 00 00 00 00 //24
00 00 00 00 00 //25
00 00 00 00 00 //26
00 00 00 00 00 //27
00 00 00 00 00 //28
00 00 00 00 00 //29
00 00 00 00 00 //30
00 00 00 00 00 //31
00 00 00 00 00 //32
end // hex
 

DarkP1xel

Сила воли наше всё.
BH Team
3,635
4,983
Выходит из текущего пользователя системы.

CLEO:
:WindowsLogOff
// 0AB1: call_scm_func @WindowsLogOff 0
0AA2: 31@ = load_library "User32.DLL"
0AA4: 30@ = get_proc_address "ExitWindowsEx" library 31@
0AA5: call 30@ num_params 2 pop 0 0x0 0x0
0AA3: free_library 31@
0AB2: ret 0
 
  • Нравится
Реакции: Сэнд и unInstance

Niko

Известный
Проверенный
230
270
Написать текст в чат 0.3.7:
Код:
:TextInChat
// Example: 0AB1: call @TextInChat 1 text 0@
0AA2: 31@ = load_library "kernel32.dll" // IF and SET
0AA4: 30@ = get_proc_address "GetModuleHandleA" library 31@ // IF and SET
0AA7: call_function 30@ num_params 1 pop 0 "samp.dll" 3@
0A8E: 2@ = 3@ + 0x21A0E4
0A8D: 1@ = read_memory 2@ size 4 virtual_protect 1
0A8E: 2@ = 3@ + 0x64010
0AA6: call_method 2@ struct 1@ num_params 5 pop 0 params 0 0xFFFFFFFF 0 0@ 8
0AB2: ret 0

Пример:
Код:
{$CLEO}
0000:

while true
wait 0
0AC6: 0@ = label @text offset
0AB1: call @TextInChat 1 text 0@
wait 100
end

:text
hex
"qq," 20 "epta" 00
end
Отправить текст в чат 0.3.7:
Код:
0AB1: call @GetSampBase 0 1@
1@ += 0x57F0
0AA5: call 1@ num_params 1 pop 0 "qq epta"

:GetSampBase
0AA2: 31@ = load_library "kernel32.dll" // IF and SET
0AA4: 30@ = get_proc_address "GetModuleHandleA" library 31@ // IF and SET
0AA7: call_function 30@ num_params 1 pop 0 "samp.dll" 0@
0ab2: ret 1 0@

Пример:
Код:
{$CLEO}
0000:

while true
wait 0
0AB1: call @GetSampBase 0 1@
1@ += 0x57F0
0AA5: call 1@ num_params 1 pop 0 "qq, epta"
wait 100
end
 
Последнее редактирование:

DarkP1xel

Сила воли наше всё.
BH Team
3,635
4,983
С помощью этой функции можно отключить/включить возможность управлять мышкой и клавиатурой.

Использование:
CLEO:
0AB1: call_scm_func @BlockInput 1 1 25@ | 1 - Отключить возможность управлять мышкой и клавиатурой. 0 - Включить.[/PHP]


[B]Функция:[/B]
[PHP]:BlockInput
0AA2: 10@ = load_library "User32.DLL"
0AA4: 11@ = get_proc_address "BlockInput" library 10@
0AA7: call_function 11@ num_params 1 pop 0 0@ 25@
0AA3: free_library 10@
0AB2: ret 1 25@
 
  • Нравится
Реакции: p1cador и AWRage