NOTE:
This code was made using
google search engine and
NOTEPAD++
I do not have any cleo related stuff.
By adding digits you can specify how long name or surname you wanna extract!
Example 1, suranem will be 3 letters long:
PHP:
0AD4: $NOT_USED = 2@v "%[^_]_%3[^_]" 10@v 20@v //10@v = first name, 20@v = last name
Example 2, name will be 4 letters long:
PHP:
0AD4: $NOT_USED = 2@v "%4[^_]_%[^_]" 10@v 20@v //10@v = first name, 20@v = last name
Also i would recommend lowercase all text because there's no human which always write text in uppercase...
Code:
PHP:
{$CLEO .CS}
0000: NOP
REPEAT
WAIT 0
UNTIL 0AFA: SAMP_IS_READY
0A8C: write_memory 0x8A5A80 size 4 value 0x7FFFFFFF virtual_protect 1 // Increase the stream memory limit
WHILE TRUE
WAIT 0
IF 0B61: samp is_local_player_spawned
THEN
0AC8: 0@ = allocate_memory_size 260
0AC8: 2@ = allocate_memory_size 260
0B75: samp get_chat_string 99 text_to 0@ prefix_to 1@ color_to 2@ prefix_color_to 3@
0C17: 4@ = strlen 0@
IF 0019: 4@ > 0 // check if string is empty
THEN
IF 0AD4: $NOT_USED = scan_string 0@ format "NR %s:" 2@v
THEN
0AD4: $NOT_USED = 2@v "%[^_]_%[^_]" 10@v 20@v //10@v = first name, 20@v = last name
printf "Received Name: %s Surname: %s" 5000 10@v 20@v
// do something to the player who sent the message
END
END
0AC9: free_allocated_memory 0@
0AC9: free_allocated_memory 1@
END
END