Вопросы по CLEO-скриптингу

hnnssy

Известный
Друг
2,684
2,765
CLEO:
{$CLEO}
{$INCLUDE SF}
0000:

repeat
    wait 2000
until 0AFA:  is_samp_available

0BE3: raknet setup_incoming_rpc_hook @hook

while true
wait 0
end

:hook
0BE5: raknet 3@ = get_hook_param PARAM_PACKETID
10@=1
if
3@==105
then
10@=0
end
0BE0: raknet hook_ret 10@
так?)
:hook
0BE5: raknet 3@ = get_hook_param PARAM_PACKETID
if
3@ == 105
then 0BE0: raknet hook_ret false
end
0BE0: raknet hook_ret true
 
  • Нравится
Реакции: Perojek)0

NoneOne

Новичок
3
0
CLEO:
:rfp
if call @is_racecp_active 0
then
 call @get_racecp_pos 0 X 1@ Y 2@ Z 3@
 0AD1: show_formatted_text_highpriority "%f %f %f" time 1448 1@ 2@ 3@
 if Actor.Driving($PLAYER_ACTOR)
 then
 call @incar 3 X 1@ Y 2@ Z 3@ 
 else
 call @onfoot 3 X 1@ Y 2@ Z 3@
 end
else
 0AD1: show_formatted_text_highpriority "race checkpoint not found" time 1448
end
samp.CmdRet()
Как этот код перевести в .dll что бы инжектить в игру CRMP
 

Perojek)0

Известный
205
3
Как можно проверить, являюсь ли я водителем авто, в котором сижу?
 

itsLegend

Фонд борьбы за жуков 🐞
Администратор
2,696
1,468
CLEO:
046C: 1@ = car 0@ driver
if 003C: $PLAYER_ACTOR == 1@
then
    //
end

Как этот код перевести в .dll что бы инжектить в игру CRMP
Этот - никак.
Тут половины функций нет, да и с такой легкостью в твоих словах - это будет тебе не под силу.
 
  • Нравится
Реакции: Perojek)0

NoneOne

Новичок
3
0
CLEO:
046C: 1@ = car 0@ driver
if 003C: $PLAYER_ACTOR == 1@
then
    //
end


Этот - никак.
Тут половины функций нет, да и с такой легкостью в твоих словах - это будет тебе не под силу.
Код:
{$CLEO .cs} 

0662: "by woksonal blasthack.net"
0662: "offsets - 0B36" 

if not 0@ = SAMP.Base()
then 0A93: end_custom_thread
end

while not SAMP.Available()
 wait 100
end

0B34: samp register_client_command "fp" to_label @fp
0B34: samp register_client_command "gp" to_label @gp
0B34: samp register_client_command "rfp" to_label @rfp
0B34: samp register_client_command "rgp" to_label @rgp

0BDE: pause_thread 0

:fp
if call @is_cp_active 0
then
 call @get_cp_pos 0 X 1@ Y 2@ Z 3@
 0AD1: show_formatted_text_highpriority "%f %f %f" time 1448 1@ 2@ 3@
 if Actor.Driving($PLAYER_ACTOR)
 then
 call @incar 3 X 1@ Y 2@ Z 3@
 else
 call @onfoot 3 X 1@ Y 2@ Z 3@
 end
else
 0AD1: show_formatted_text_highpriority "checkpoint not found" time 1448
end
samp.CmdRet()

:gp
if call @is_cp_active 0
then
 call @get_cp_pos 0 X 1@ Y 2@ Z 3@
 0AD1: show_formatted_text_highpriority "%f %f %f" time 1448 1@ 2@ 3@
 if Actor.Driving($PLAYER_ACTOR)
 then
 Actor.PutAt($PLAYER_ACTOR, 1@, 2@, 3@) 
 else
 call @actor_teleport 3 X 1@ Y 2@ Z 3@
 end
else
 0AD1: show_formatted_text_highpriority "checkpoint not found" time 1448
end
samp.CmdRet() 

:rfp
if call @is_racecp_active 0
then
 call @get_racecp_pos 0 X 1@ Y 2@ Z 3@
 0AD1: show_formatted_text_highpriority "%f %f %f" time 1448 1@ 2@ 3@
 if Actor.Driving($PLAYER_ACTOR)
 then
 call @incar 3 X 1@ Y 2@ Z 3@ 
 else
 call @onfoot 3 X 1@ Y 2@ Z 3@
 end
else
 0AD1: show_formatted_text_highpriority "race checkpoint not found" time 1448
end
samp.CmdRet()

:rgp
if call @is_racecp_active 0
then
 call @get_racecp_pos 0 X 1@ Y 2@ Z 3@
 0AD1: show_formatted_text_highpriority "%f %f %f" time 1448 1@ 2@ 3@
 if Actor.Driving($PLAYER_ACTOR)
 then
 Actor.PutAt($PLAYER_ACTOR, 1@, 2@, 3@) 
 else
 call @actor_teleport 3 X 1@ Y 2@ Z 3@
 end
else
 0AD1: show_formatted_text_highpriority "race checkpoint not found" time 1448
end
samp.CmdRet() 

:onfoot
0B2B: samp 9@ = get_player_id_by_actor_handle $PLAYER_ACTOR 
0AC8: 10@ = allocate_memory_size 68 
0BBA: samp store_player 9@ onfoot_data 10@ 
0C0D: struct 10@ offset 6 size 4 = 0@
0C0D: struct 10@ offset 10 size 4 = 1@
0C0D: struct 10@ offset 14 size 4 = 2@
0BC0: samp send_onfoot_data 10@ 
0AC9: free_allocated_memory 10@ 
0AB2: ret 0 

:incar
0B2B: samp 13@ = get_player_id_by_actor_handle $PLAYER_ACTOR 
0AC8: 14@ = allocate_memory_size 63 
0BBB: samp store_player 13@ incar_data 14@
0C0D: struct 14@ offset 24 size 4 = 0@
0C0D: struct 14@ offset 28 size 4 = 1@
0C0D: struct 14@ offset 32 size 4 = 2@
0C0D: struct 14@ offset 36 size 4 = 0.0 
0C0D: struct 14@ offset 40 size 4 = 0.0 
0C0D: struct 14@ offset 44 size 4 = 0.0
0BC1: samp send_incar_data 14@ 
0AC9: free_allocated_memory 14@
0AB2: ret 0

:is_cp_active
if 0AA2: 0@ = loadlib "samp.dll"
then 0A8E: 1@ = 0@ + 0x21A10C
 0A8D: 1@ = readMem 1@ sz 4 vp 0
 1@ += 0x24
 0A8D: 1@ = readMem 1@ sz 4 vp 0
 if 1@ == true
 then 0485: return_true
 else 059A: return_false
 end
 0AA3: freelib 0@
end
0AB2: ret 0

:get_cp_pos
if 0AA2: 0@ = loadlib "samp.dll"
then 0A8E: 1@ = 0@ + 0x21A10C
 0A8D: 1@ = readMem 1@ sz 4 vp 0
 1@ += 0xC
 0A8D: 2@ = readMem 1@ sz 4 vp 0
 1@ += 0x4
 0A8D: 3@ = readMem 1@ sz 4 vp 0
 1@ += 0x4
 0A8D: 4@ = readMem 1@ sz 4 vp 0
 0AA3: freelib 0@
end
0AB2: ret 3 2@ 3@ 4@

:is_racecp_active
if 0AA2: 0@ = loadlib "samp.dll"
then 0A8E: 1@ = 0@ + 0x21A10C
 0A8D: 1@ = readMem 1@ sz 4 vp 0
 1@ += 0x49
 0A8D: 1@ = readMem 1@ sz 4 vp 0
 if 1@ == true
 then 0485: return_true
 else 059A: return_false
 end
 0AA3: freelib 0@
end
0AB2: ret 0

:get_racecp_pos
if 0AA2: 0@ = loadlib "samp.dll"
then 0A8E: 1@ = 0@ + 0x21A10C
 0A8D: 1@ = readMem 1@ sz 4 vp 0
 1@ += 0x2C
 0A8D: 2@ = readMem 1@ sz 4 vp 0
 1@ += 0x4
 0A8D: 3@ = readMem 1@ sz 4 vp 0
 1@ += 0x4
 0A8D: 4@ = readMem 1@ sz 4 vp 0
 0AA3: freelib 0@
end
0AB2: ret 3 2@ 3@ 4@

:actor_teleport
0A96: 4@ = actor $PLAYER_ACTOR struct
4@ += 20
0A8D: 4@ = read_memory 4@ size 4 virtual_protect 0
4@ += 48
0A8C: write_memory 4@ size 4 value 0@ virtual_protect 0
4@ += 4
0A8C: write_memory 4@ size 4 value 1@ virtual_protect 0
4@ += 4
0A8C: write_memory 4@ size 4 value 2@ virtual_protect 0
ret 0
 

noordan

Новичок
4
1
Найдите ошибку, пожалуйста. Надо, чтобы это все на кнопку активировалось, а потом деактивировалось.
CLEO:
{$CLEO .cs}
0000: NOP
thread 'AUTOHEAL'
wait 2000
repeat
wait 0
if or
0B21: samp is_chat_opened
0B4C: samp is_dialog_active -1
then
wait 0
end
if key_down 82
chatmsg "AUTOHEAL by Brody активирован"
jump @usedrugs

:usedrugs
wait 0
if
0B61: samp is_local_player_spawned
jf @usedrugs
0226: 0@ = actor $PLAYER_ACTOR health
jump @hp_10

:hp_10
wait 0
if 0@ <= 40
then
0AF9: samp say_msg "/healme"
end
wait 1000
jump @usedrugs

until 0AB0: 82
while 0AB0: 82
wait 0
end
chatmsg "AUTOHEAL by Brody деактивирован"
 

hnnssy

Известный
Друг
2,684
2,765
Код:
{$CLEO .cs}

0662: "by woksonal blasthack.net"
0662: "offsets - 0B36"

if not 0@ = SAMP.Base()
then 0A93: end_custom_thread
end

while not SAMP.Available()
wait 100
end

0B34: samp register_client_command "fp" to_label @fp
0B34: samp register_client_command "gp" to_label @gp
0B34: samp register_client_command "rfp" to_label @rfp
0B34: samp register_client_command "rgp" to_label @rgp

0BDE: pause_thread 0

:fp
if call @is_cp_active 0
then
call @get_cp_pos 0 X 1@ Y 2@ Z 3@
0AD1: show_formatted_text_highpriority "%f %f %f" time 1448 1@ 2@ 3@
if Actor.Driving($PLAYER_ACTOR)
then
call @incar 3 X 1@ Y 2@ Z 3@
else
call @onfoot 3 X 1@ Y 2@ Z 3@
end
else
0AD1: show_formatted_text_highpriority "checkpoint not found" time 1448
end
samp.CmdRet()

:gp
if call @is_cp_active 0
then
call @get_cp_pos 0 X 1@ Y 2@ Z 3@
0AD1: show_formatted_text_highpriority "%f %f %f" time 1448 1@ 2@ 3@
if Actor.Driving($PLAYER_ACTOR)
then
Actor.PutAt($PLAYER_ACTOR, 1@, 2@, 3@)
else
call @actor_teleport 3 X 1@ Y 2@ Z 3@
end
else
0AD1: show_formatted_text_highpriority "checkpoint not found" time 1448
end
samp.CmdRet()

:rfp
if call @is_racecp_active 0
then
call @get_racecp_pos 0 X 1@ Y 2@ Z 3@
0AD1: show_formatted_text_highpriority "%f %f %f" time 1448 1@ 2@ 3@
if Actor.Driving($PLAYER_ACTOR)
then
call @incar 3 X 1@ Y 2@ Z 3@
else
call @onfoot 3 X 1@ Y 2@ Z 3@
end
else
0AD1: show_formatted_text_highpriority "race checkpoint not found" time 1448
end
samp.CmdRet()

:rgp
if call @is_racecp_active 0
then
call @get_racecp_pos 0 X 1@ Y 2@ Z 3@
0AD1: show_formatted_text_highpriority "%f %f %f" time 1448 1@ 2@ 3@
if Actor.Driving($PLAYER_ACTOR)
then
Actor.PutAt($PLAYER_ACTOR, 1@, 2@, 3@)
else
call @actor_teleport 3 X 1@ Y 2@ Z 3@
end
else
0AD1: show_formatted_text_highpriority "race checkpoint not found" time 1448
end
samp.CmdRet()

:onfoot
0B2B: samp 9@ = get_player_id_by_actor_handle $PLAYER_ACTOR
0AC8: 10@ = allocate_memory_size 68
0BBA: samp store_player 9@ onfoot_data 10@
0C0D: struct 10@ offset 6 size 4 = 0@
0C0D: struct 10@ offset 10 size 4 = 1@
0C0D: struct 10@ offset 14 size 4 = 2@
0BC0: samp send_onfoot_data 10@
0AC9: free_allocated_memory 10@
0AB2: ret 0

:incar
0B2B: samp 13@ = get_player_id_by_actor_handle $PLAYER_ACTOR
0AC8: 14@ = allocate_memory_size 63
0BBB: samp store_player 13@ incar_data 14@
0C0D: struct 14@ offset 24 size 4 = 0@
0C0D: struct 14@ offset 28 size 4 = 1@
0C0D: struct 14@ offset 32 size 4 = 2@
0C0D: struct 14@ offset 36 size 4 = 0.0
0C0D: struct 14@ offset 40 size 4 = 0.0
0C0D: struct 14@ offset 44 size 4 = 0.0
0BC1: samp send_incar_data 14@
0AC9: free_allocated_memory 14@
0AB2: ret 0

:is_cp_active
if 0AA2: 0@ = loadlib "samp.dll"
then 0A8E: 1@ = 0@ + 0x21A10C
0A8D: 1@ = readMem 1@ sz 4 vp 0
1@ += 0x24
0A8D: 1@ = readMem 1@ sz 4 vp 0
if 1@ == true
then 0485: return_true
else 059A: return_false
end
0AA3: freelib 0@
end
0AB2: ret 0

:get_cp_pos
if 0AA2: 0@ = loadlib "samp.dll"
then 0A8E: 1@ = 0@ + 0x21A10C
0A8D: 1@ = readMem 1@ sz 4 vp 0
1@ += 0xC
0A8D: 2@ = readMem 1@ sz 4 vp 0
1@ += 0x4
0A8D: 3@ = readMem 1@ sz 4 vp 0
1@ += 0x4
0A8D: 4@ = readMem 1@ sz 4 vp 0
0AA3: freelib 0@
end
0AB2: ret 3 2@ 3@ 4@

:is_racecp_active
if 0AA2: 0@ = loadlib "samp.dll"
then 0A8E: 1@ = 0@ + 0x21A10C
0A8D: 1@ = readMem 1@ sz 4 vp 0
1@ += 0x49
0A8D: 1@ = readMem 1@ sz 4 vp 0
if 1@ == true
then 0485: return_true
else 059A: return_false
end
0AA3: freelib 0@
end
0AB2: ret 0

:get_racecp_pos
if 0AA2: 0@ = loadlib "samp.dll"
then 0A8E: 1@ = 0@ + 0x21A10C
0A8D: 1@ = readMem 1@ sz 4 vp 0
1@ += 0x2C
0A8D: 2@ = readMem 1@ sz 4 vp 0
1@ += 0x4
0A8D: 3@ = readMem 1@ sz 4 vp 0
1@ += 0x4
0A8D: 4@ = readMem 1@ sz 4 vp 0
0AA3: freelib 0@
end
0AB2: ret 3 2@ 3@ 4@

:actor_teleport
0A96: 4@ = actor $PLAYER_ACTOR struct
4@ += 20
0A8D: 4@ = read_memory 4@ size 4 virtual_protect 0
4@ += 48
0A8C: write_memory 4@ size 4 value 0@ virtual_protect 0
4@ += 4
0A8C: write_memory 4@ size 4 value 1@ virtual_protect 0
4@ += 4
0A8C: write_memory 4@ size 4 value 2@ virtual_protect 0
ret 0
забудь об этом, никто делать этого тебе не будет
 

NoneOne

Новичок
3
0
CLEO:
046C: 1@ = car 0@ driver
if 003C: $PLAYER_ACTOR == 1@
then
    //
end


Этот - никак.
Тут половины функций нет, да и с такой легкостью в твоих словах - это будет тебе не под силу.
Код:
// main.cpp
// Файл main.h тут: http://pastebin.com/SGrsgYnV

#include <windows.h>
#include "main.h"

LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch ( uMsg )
    {
        case WM_KEYUP:
        {
            switch ( wParam )
            {
                case VK_F10:
                {
                    AddMessageJumpQ("Hello World: 1", 500, NULL, false);
                    break;
                }
                case VK_F11:
                {
                    AddMessageJumpQ("Hello World: 2", 500, NULL, false);
                }
            }
        }
    }
    return CallWindowProcA(WNDPROC(pDLLProject.PrevWndFunc), hwnd, uMsg, wParam, lParam);
}

BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
    switch ( fdwReason )
    {
        case DLL_PROCESS_ATTACH:
        {
            pDLLProject.PrevWndFunc = SetWindowLongA(FindWindowA(NULL, "GTA:SA:MP"), GWL_WNDPROC, LONG(WindowProc));
        }
    }
    return TRUE;
}
вот сюда как нибудь
 

deddosouru

Смотрю аниме, служу Сатане
Друг
2,036
1,323
пересадите мне руки с жопы на нужное место

CLEO:
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP

:sampinit
wait 300
while SAMP.Available
goto @tread
end
jf @sampinit

:tread
25@ = Audiostream.Load("CLEO\sample.wav")
for 20@ = 0 to 999
17@ = SAMP.GetActorHandleByPlayerID(20@)

:tread_1
wait 0
while true
    wait 0
    if Actor.Dead($PLAYER_ACTOR)
    then
        Audiostream.PerformAction(25@, PLAY)
        while Actor.Dead($PLAYER_ACTOR)
            wait 0
        end
    end
end
if
051A: actor 17@ damaged_by_actor $PLAYER_ACTOR
jf @redirect
054E: clear_actor 17@ damage
Audiostream.PerformAction(25@, PLAY)
wait 0

:redirect
goto @tread_1
 

p1cador

cerf
Проверенный
221
359
пересадите мне руки с жопы на нужное место
звук сам добавишь
CLEO:
{$CLEO .cs}
0000:
while not SAMP.Available()
    wait 100
end
//тут загрузка звука

while true
    wait 0
    for 31@ = 0 to 1001 step 1
        if and
        0B20: samp 30@ = actor_handle_by_samp_player_id 31@
        051A: actor 30@ damaged_by_actor $PLAYER_ACTOR
            then
            054E: clear_actor 30@ damage             
            0af8: "dmg: {ffffff}%d" 0xff0000  31@
            //тут воспроизведение  
        end
    end
end
 
Последнее редактирование:
  • Нравится
Реакции: deddosouru

deddosouru

Смотрю аниме, служу Сатане
Друг
2,036
1,323
звук сам добавишь
CLEO:
{$CLEO .cs}
0000:
while not SAMP.Available()
    wait 100
end
//тут загрузка звука

while true
    wait 0
    for 31@ = 0 to 1001 step 1
        if and
        0B20: samp 30@ = actor_handle_by_samp_player_id 31@
        051A: actor 30@ damaged_by_actor $PLAYER_ACTOR
            then
            054E: clear_actor 30@ damage            
            0af8: "dmg: {ffffff}%d" 0xff0000  31@
            //тут воспроизведение 
        end
    end
end
сначала пытался в другой код вшить, не помогло. подумал что руки кривоваты.
потом скомпилировал отдельно и чот не хочет работать.
 

Вложения

  • coin.cs
    17.7 KB · Просмотры: 7

p1cador

cerf
Проверенный
221
359
Ну вывод в чат при попадании работает. Чтобы звук был слышен, добавь громкость радио в игре и перезайди.
еще загрузку звука как вариант сделай в цикле, но это такое