CLEO Help Scan String

CLEO related
Status
Not open for further replies.

petriqqq

Member
Joined
Feb 13, 2022
Messages
16
Reaction score
0
Location
Ma-ta
Hello guys, i have tried different situations after searching on here for others that have the same issue.
I just cannot make it... as the following picture, i want to scan the string when i type /id on someone to scan his id from here and automaticly send him a /sms text

If anyone got any idea or a sample script for me please.. i just cant make it.. i only want to scan the id of the player from this string and just send a /sms to that respectiv player
 

petriqqq

Member
Joined
Feb 13, 2022
Messages
16
Reaction score
0
Location
Ma-ta
What i tried but not working ..

{$CLEO .cs}
0000:

REPEAT
WAIT 0
UNTIL 0AFA: SAMP_IS_READY

WHILE TRUE
WAIT 0

0AC8: 0@ = allocate_memory_size 260
0AC8: 1@ = allocate_memory_size 260
0AC8: 5@ = 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 "(ID %d) %s | Level: %d | Faction: %s" $NOT_USED 4@v
THEN
wait 1000
format 5@ "/sms %d Test." 4@v
say 5@
wait 1000
END

0AC9: free_allocated_memory 0@
0AC9: free_allocated_memory 1@
0AC9: free_allocated_memory 5@

END
 

petriqqq

Member
Joined
Feb 13, 2022
Messages
16
Reaction score
0
Location
Ma-ta
I have also tried after this format too, still not going on.



{$CLEO .cs}

0000: NOP

:pEPE_255
wait 0
if and
0AB0: 18
0AB0: 49
jf @PEPE_39
if
31@ == 0
then
wait 200
31@ = 1
0ACD: show_text_highpriority "SMS via /id ~g~ENABLED" time 1000
else
wait 200
31@ = 0
0ACD: show_text_highpriority "SMS via /id ~r~DISABLED" time 1000
end

:pEPE_39
wait 0
if
31@ == 1
jf @PEPE_255
0AC8: 0@ = allocate_memory_size 260
0AB1: call @getChatEntryText 1 id 99 to 0@


if
0AD4: 30@ = scan_string 0@ format "(ID %d) %s | Level: %d | Faction: %s |Phone: %d | FPS %d" 28@ 25@v 24@v 23@v 22@v 21@v
else_jump @PEPE_255
0AF9: "/SMS %d nu dau nimic" 28@
0AC9: free_allocated_memory 0@
jump @PEPE_255

:getChatEntryText
wait 500
0AA2: 1@ = "samp.dll"
1@ += 0x212A6C
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
1@ += 0x136
0@ *= 252
005A: 1@ += 0@
1@ += 28
0AB2: ret 1 1@
 

dphome

Well-known member
Joined
Mar 21, 2020
Messages
456
Solutions
9
Reaction score
165
Location
Poland
For 0.3.7 R1 + SAMPFUNCS
PHP:
{$CLEO .cs}
{$USE bitwise}
0000:

WHILE TRUE
WAIT 0

IF 0ADC:   test_cheat "ZC"
THEN
    0B12: 30@ = 30@ XOR 1        
    IF 0039:   30@ == 1
    THEN 0AD1: show_formatted_text_highpriority "~w~Script ~g~ON" time 1337
    ELSE 0AD1: show_formatted_text_highpriority "~w~Script ~r~OFF" time 137
    END
END

IF 30@ == 1
THEN
    0AC8: 0@ = allocate_memory_size 1024
    0AC8: 1@ = allocate_memory_size 1024
    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 "(ID %i)" 4@                 
    THEN
        // 0AF9: samp say_msg "/sms %i Test." 4@                                                                       
        0AD1: show_formatted_text_highpriority "~w~/sms ~g~%i ~w~Test." time 1337 4@
        WAIT 1337  
    END
END

/* TEST */
IF 0AB0:   key_pressed 49 // 1
THEN
    0209: $RAND = random_int_in_ranges 0 3
    0AC8: $RAND_MSG = allocate_memory_size 64    
    IF $RAND == 0
    THEN 0AD3: $RAND_MSG = format "(ID 100) [NH]Tokay | Level: 5 | Faction: None | Phone: 57030 | FPS: 91"  
    END    
    IF $RAND == 1
    THEN 0AD3: $RAND_MSG = format "(ID 112) [zF]JS[] | Level: 14 | Faction: Paramedic Department (rank 1) | Phone: 90479 | FPS: 132"
    END
    IF $RAND == 2
    THEN 0AD3: $RAND_MSG = format "(ID 113) Kevin_YT[A] | Level: 100 | Faction: Tow Truck Company SF (rank 7) | Phone: Kev | FPS: 61"  
    END    
    0AF8: samp add_message_to_chat $RAND_MSG color -1
    0AC9: free_allocated_memory $RAND_MSG
    WAIT 137    
END
/* TEST */

END
0A93: terminate_this_custom_script
 

Attachments

  • Script.cs
    19.4 KB · Views: 2
Status
Not open for further replies.
Top