CLEO Help I need one specific cleo scrpt

CLEO related

RazooorS

Active member
Joined
Feb 16, 2019
Messages
61
Reaction score
0
i want to create a script when something show in a chat auto replay i create some script but i cant compile this i have some errors
Code:
{$CLEO .cs}
{$USE SAMPFUNCS}

0000:

repeat
    wait 0
until 0AFA: is_samp_loaded

repeat
    wait 0
until 0AFA: is_samp_available

while true
    wait 0

    if 0BDE: samp_received_server_message 1@
    then
        if 0C29: string_compare 1@ to_string "there is a message" ignore_case false
        then
            0AFA: samp_send_chat "/yourcommand"
            wait 500
        end
    end
end
 

Subhan

New member
Joined
Aug 4, 2015
Messages
3
Reaction score
0
0BDE: samp_received_server_message 1@
this is incorrect
opcode 0BDE is used to pause the script

0AFA: samp_send_chat "/yourcommand"
this is also incorrect
0AFA is used to check if samp is available/loaded
use 0AF9 to send chat messages & commands

check opcodes here before using https://library.sannybuilder.com/#/sa/script/extensions/SAMPFUNCS/0BDE

there is opcode 0B75 samp_get_chat_line to capture message from specific chat line 99 being last line but sometimes if several messages appear at same time or chat is going up so fast then script can miss the message so catching the message through RPC is better opcode 0BE3 SAMP_RAKNET_HOOK_INCOMING_RPC

Code:
{$CLEO .cs}
{$USE SAMPFUNCS}
0000: NOP

03A4: script_name "Read Server Message"

repeat
    wait 1
until 0AFA:  is_samp_available

if not 0BE3: raknet setup_incoming_rpc_hook @RPC_In
then 0A93: end_custom_thread
end

0BDE: pause_thread 0
0A93: end_custom_thread

:RPC_In
    0BE5: raknet 0@ = get_hook_param 1
    if 0@ == 93 // this 93 means server chat messages RPC packets
    then
        0BE5: raknet 1@ = get_hook_param 0
        0BE7: raknet 2@ = bit_stream_read 1@ type 0
        if 2@ > 124
        then 2@ = 124
        end
        2@++
        0AC8: 3@ = allocate_memory_size 2@
        2@--
        0BE8: raknet bit_stream 1@ read_array 3@ size 2@
        0C0D: struct 3@ offset 2@ size 1 = 0
        
        if 0C29: 33@ = stristr string1 3@ string2 "there is a message"
        then
            0AF9: samp_send_chat_message "/yourcommand"
        end
        
        0AC9: free_allocated_memory 3@
        0BE9: raknet bit_stream 1@ reset_read_pointer
    end
0BE0: raknet hook_ret true
 
Top