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

kawa operand

перерывпятьминут
602
333
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
  • Нравится
Реакции: Zefir2511

ymaril

Известный
2
0
Добрый день. А есть какая-нибудь возможность сделать ещё одно, фейковое, подключение к серверу в клео?
 

Kristyan

Известный
165
16
Кто может помочь мне с одним примером который читает string из чата ?
 

CLEONewBie

Новичок
20
0
Как это оптимизировать, что-бы игра не фризилась? (Играть вообще не возможно:sad_frog2:)
CLEO:
{$CLEO .cs}
0000: NOP
0@ = 0
repeat
    wait 0
until SAMP.Available()
0B63: samp unregister_client_command "sc"
0B34: samp register_client_command "sc" to_label @color
while true
    Wait 0
    if 0@ == 1
    then
        0C8A: samp 5@ = get_max_player_id streamed_only false
        for 1@ = 0 to 5@
            wait 100 
            2@ = SAMP.GetPlayerNickname(1@)
            log "%d" 1@
            if 0C14: strcmp string1 2@ string2 "Yang_Santana"
            then
                chatmsg "%s[%d] Detected" -1 2@ 1@
                4@ += 1 
            end
            SAMP
            if 0C14: strcmp string1 2@ string2 "William_Santana"
            then
                chatmsg "%s[%d] Detected" -1 2@ 1@
                4@ += 1 
            end
            if 0C14: strcmp string1 2@ string2 "Joseph_Santana"
            then
                chatmsg "%s[%d] Detected" -1 2@ 1@
                4@ += 1 
            end
            if 0C14: strcmp string1 2@ string2 "Manuel_Mesa"
            then
                chatmsg "%s[%d] Detected" -1 2@ 1@
                4@ += 1 
            end
            if 0C14: strcmp string1 2@ string2 "Dante_Santana"
            then
                chatmsg "%s[%d] Detected" -1 2@ 1@
                4@ += 1 
            end
            if 0C14: strcmp string1 2@ string2 "Fernando_Santana"
            then
                chatmsg "%s[%d] Detected" -1 2@ 1@
                4@ += 1 
            end
            if 0C14: strcmp string1 2@ string2 "Jules_Santana"
            then
                chatmsg "%s[%d] Detected" -1 2@ 1@
                4@ += 1 
            end
            if 0C14: strcmp string1 2@ string2 "Jared_Santana"
            then
                chatmsg "%s[%d] Detected" -1 2@ 1@
                4@ += 1 
            end
            if 0C14: strcmp string1 2@ string2 "Justin_Santana"
            then
                chatmsg "%s[%d] Detected" -1 2@ 1@
                4@ += 1 
            end
            if 0C14: strcmp string1 2@ string2 "Romcha_Santana"
            then
                chatmsg "%s[%d] Detected" -1 2@ 1@
                4@ += 1 
            end
            if 0C14: strcmp string1 2@ string2 "Alex_Santana"
            then
                chatmsg "%s[%d] Detected" -1 2@ 1@
                4@ += 1 
            end
            if 0C14: strcmp string1 2@ string2 "Lil_Santana"
            then
                chatmsg "%s[%d] Detected" -1 2@ 1@
                4@ += 1 
            end
            if 0C14: strcmp string1 2@ string2 "Zak_Santana"
            then
                chatmsg "%s[%d] Detected" -1 2@ 1@
                4@ += 1 
            end
            if 0C14: strcmp string1 2@ string2 "Bob_Santana"
            then
                chatmsg "%s[%d] Detected" -1 2@ 1@
                4@ += 1 
            end
            if 0C14: strcmp string1 2@ string2 "Adriano_Santana"
            then
                chatmsg "%s[%d] Detected" -1 2@ 1@
                4@ += 1 
            end
            if 0C14: strcmp string1 2@ string2 "Raul_Santana"
            then
                chatmsg "%s[%d] Detected" -1 2@ 1@
                4@ += 1 
            end
            if 0C14: strcmp string1 2@ string2 "Riccardo_Santana"
            then
                chatmsg "%s[%d] Detected" -1 2@ 1@
                4@ += 1 
            end
            if 0C14: strcmp string1 2@ string2 "Sanchez_Santana"
            then
                chatmsg "%s[%d] Detected" -1 2@ 1@
                4@ += 1 
            end
            if 0C14: strcmp string1 2@ string2 "Ernesto_Santana"
            then
                chatmsg "%s[%d] Detected" -1 2@ 1@
                4@ += 1 
            end
            if 0C14: strcmp string1 2@ string2 "Bill_Santana"
            then
                chatmsg "%s[%d] Detected" -1 2@ 1@
                4@ += 1 
            end
            if 0C14: strcmp string1 2@ string2 "Emiliano_Santana"
            then
                chatmsg "%s[%d] Detected" -1 2@ 1@
                4@ += 1 
            end
        end
        0@ = 0
        chatmsg "Total Santans detected: %s" -1 4@
    end
end
:color
0B12: 0@ = 0@ XOR 1
SAMP.CmdRet()
 
1,417
1,029
@CLEONewBie
CLEO:
{$CLEO}
0000: NOP

repeat
    wait 0
until SAMP.Available()

0B63: samp unregister_client_command "sc"
0B34: samp register_client_command "sc" to_label @color

while true
wait 0
    if 0@ == 1
    then
        for 1@ = 0 to 1000
            IF 0B23:  samp is_player_connected 1@
            THEN
                0B36: samp 2@ = get_player_nickname 1@
                IF OR
                0C29: 33@ = stristr string1 2@ string2 "_Santana"
                0C14: strcmp string1 2@ string2 "Manuel_Mesa"
                THEN
                    0AF8: "%s[%d] Detected" -1 2@ 1@
                    4@++            
                END
            END
        END
        0@ = 0
        IF 8039: 4@ == 0
        THEN
            0AF8: "Total Santans detected: %d" -1 4@
        ELSE
            0AF8: "Not found" -1
        END
    end
end

:color
0@ = 1
SAMP.CmdRet()

"фризилось" у тебя из-за этой строки
CLEO:
chatmsg "Total Santans detected: %s" -1 4@
в переменной 4 у тебя не строка, а число.
 

Mc.Reptar

Известный
33
3
Как сделать так, чтобы при входе в SA:MP нажимало F11, это чтобы скрипт активировать. Не лень нажимать самому, просто забываю постоянно. Спасибо.

Кто поможет решить проблему? Заранее спасибо.
 

Вложения

  • 19993575.jpg
    19993575.jpg
    224.8 KB · Просмотры: 381
Последнее редактирование модератором:

NookieONE

Участник
128
1
Всем привет.

Нужен скрипт, который при попадании в чат определенной фразы добавлял бы в счетчик 1.
Пример.

CLEO:
{$CLEO}
0000:
repeat
wait 0
until samp.Available()


while true
wait 0
    repeat
        wait 0
        alloc 1@ 256
        0B75: samp get_chat_string 99 text_to 1@ prefix_to 0 color_to 0 prefix_color_to 0
        if
            0C18: 2@ = strstr string1 1@ string2 "ТЕКСТ"
            then

             0AF0: 3@ = get_int_from_ini_file "cleo\Файл.ini" section "Счетчик" key "Кол-во"
             0A8E: 6@ = 3@ + 1
             0AF1: write_int 6@ to_ini_file "cleo\Файл.ini" section "Счетчик" key "Кол-во"
             0AC9: free_allocated_memory 5@
             0B43: samp cmd_ret

            break
            end
        free 1@
    until false
end

Но в этом скрипте он добавляет не 1, а какое-то рандомное число.
#HELP
 
1,417
1,029
Как сделать так, чтобы при входе в SA:MP нажимало F11, это чтобы скрипт активировать. Не лень нажимать самому, просто забываю постоянно. Спасибо.
не легче в самом скрипте добавить автоактивацию при входе?

@NookieONE
CLEO:
{$CLEO}
0000:
repeat
wait 0
until samp.Available()

while true
wait 0
    alloc 1@ 256
    0B75: samp get_chat_string 99 text_to 1@ prefix_to 0 color_to 0 prefix_color_to 0
    if 0C18: 2@ = strstr string1 1@ string2 "ТЕКСТ"
    then
        0AF0: 3@ = get_int_from_ini_file "cleo\Файл.ini" section "Счетчик" key "Кол-во"
        000A: 3@ += 1
        0AF1: write_int 3@ to_ini_file "cleo\Файл.ini" section "Счетчик" key "Кол-во"
    end
    free 1@
end
 

NookieONE

Участник
128
1
не легче в самом скрипте добавить автоактивацию при входе?

@NookieONE
CLEO:
{$CLEO}
0000:
repeat
wait 0
until samp.Available()

while true
wait 0
    alloc 1@ 256
    0B75: samp get_chat_string 99 text_to 1@ prefix_to 0 color_to 0 prefix_color_to 0
    if 0C18: 2@ = strstr string1 1@ string2 "ТЕКСТ"
    then
        0AF0: 3@ = get_int_from_ini_file "cleo\Файл.ini" section "Счетчик" key "Кол-во"
        000A: 3@ += 1
        0AF1: write_int 3@ to_ini_file "cleo\Файл.ini" section "Счетчик" key "Кол-во"
    end
    free 1@
end

Не работает. Все равно рандомное число добавляет