CLEO Help Help to read the chat and send a reply

CLEO related
Status
Not open for further replies.

0x73616D

Active member
Joined
Apr 18, 2021
Messages
135
Solutions
1
Reaction score
68
Location
0x73616D
Is there a way to get my name from a message that appears in the chat?

Code:
For example: My_Name accepted the gun for $ 500
 

Angel9

Active member
Joined
May 6, 2021
Messages
65
Reaction score
2
Location
Belgrade, Serbia
Code:
{$CLEO .cs}

0000: NOP

repeat
wait 0
until 0afa:

while true
wait 0

if
0B61:  samp is_local_player_spawned
then
    0AC8: 0@ = allocate_memory_size 260
    0AC8: 1@ = allocate_memory_size 260
    0B75: samp get_chat_string 99 text_to 0@ prefix_to 1@ color_to 2@ prefix_color_to 3@
    if       
    0AD4: $NOT_USED = scan_string 0@ format "My_Name accepted the gun for $ 500" // SET CHAT TEXT FIND
     then
     WAIT 2100
    say "/help" // COMMAND START AFTER READ "My_Name accepted the gun for $ 500"
         WAIT 1000
    end
end
  END
 
Last edited:

0x73616D

Active member
Joined
Apr 18, 2021
Messages
135
Solutions
1
Reaction score
68
Location
0x73616D
Code:
{$CLEO .cs}

0000: NOP

repeat
wait 0
until 0afa:

while true
wait 0

if
0B61:  samp is_local_player_spawned
then
    0AC8: 0@ = allocate_memory_size 260
    0AC8: 1@ = allocate_memory_size 260
    0B75: samp get_chat_string 99 text_to 0@ prefix_to 1@ color_to 2@ prefix_color_to 3@
    if      
    0AD4: $NOT_USED = scan_string 0@ format "My_Name accepted the gun for $ 500" // SET CHAT TEXT FIND
     then
     WAIT 2100
    say "/help" // COMMAND START AFTER READ "My_Name accepted the gun for $ 500"
         WAIT 1000
    end
end
  END
Thanks, but I mean get my name inside the server
 

[RP]Foolish

Active member
Joined
Mar 18, 2020
Messages
68
Reaction score
36
Location
sea
PHP:
{$CLEO .cs}

0000: NOP

repeat
wait 0
until 0afa:

alloc 0@ 260 //nickname
alloc 1@ 260 //formatted string to compare
alloc 2@ 260 //chatstring

WHILE TRUE
WAIT 0
    if 0B61:  samp is_local_player_spawned
    then
        //here u can edit to get your target name, i think it is your local player, idk
        0B2B: samp 3@ = get_player_id_by_actor_handle $PLAYER_ACTOR
        0B36: samp 0@ = get_player_nickname 3@
        0AD3: 1@ = format "%s accepted the gun for $ 500" 0@
       
        0B75: samp get_chat_string 99 text_to 2@ prefix_to $NOT_USED color_to $NOT_USED prefix_color_to $NOT_USED
        if      
            0C29: $NOT_USED = stristr string1 2@ string2 1@
         then
            say "/help"
            WAIT 1000
        end
    end
END
 

0x73616D

Active member
Joined
Apr 18, 2021
Messages
135
Solutions
1
Reaction score
68
Location
0x73616D
PHP:
{$CLEO .cs}

0000: NOP

repeat
wait 0
until 0afa:

alloc 0@ 260 //nickname
alloc 1@ 260 //formatted string to compare
alloc 2@ 260 //chatstring

WHILE TRUE
WAIT 0
    if 0B61:  samp is_local_player_spawned
    then
        //here u can edit to get your target name, i think it is your local player, idk
        0B2B: samp 3@ = get_player_id_by_actor_handle $PLAYER_ACTOR
        0B36: samp 0@ = get_player_nickname 3@
        0AD3: 1@ = format "%s accepted the gun for $ 500" 0@
     
        0B75: samp get_chat_string 99 text_to 2@ prefix_to $NOT_USED color_to $NOT_USED prefix_color_to $NOT_USED
        if    
            0C29: $NOT_USED = stristr string1 2@ string2 1@
         then
            say "/help"
            WAIT 1000
        end
    end
END
Crash after sending a message
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
{$CLEO .cs}

0000: NOP

repeat
wait 0
until 0afa:

alloc 0@ 260 //nickname
alloc 1@ 260 //formatted string to compare
alloc 2@ 260 //chatstring

WHILE TRUE
WAIT 0
    if 0B61:  samp is_local_player_spawned
    then
        //here u can edit to get your target name, i think it is your local player, idk
        0B2B: samp 3@ = get_player_id_by_actor_handle $PLAYER_ACTOR
        0B36: samp 0@ = get_player_nickname 3@
        0AD3: 1@ = format "%s accepted the gun for $ 500" 0@
      
        0B75: samp get_chat_string 99 text_to 2@ prefix_to $NOT_USED color_to $NOT_USED prefix_color_to $NOT_USED
        if     
            0C29: $NOT_USED = stristr string1 2@ string2 1@
         then
            say "/help"
            WAIT 1000
        end
    end
END

If you use opcode "get player name " to get your own name..
Better use it not in loop, put it before while true..
 
Status
Not open for further replies.
Top