CLEO Help What's wrong with the Script?

CLEO related
Status
Not open for further replies.

Husnain

Well-known member
Joined
May 20, 2016
Messages
228
Reaction score
9
Location
Mars
C++:
{$CLEO .cs}
0000:

REPEAT
    WAIT 0
UNTIL 0AFA:  is_samp_available
// MAKE THE CLEO ONLY WORK IF SAMPFUNCS IS LOADED


WHILE TRUE
    WAIT 0
    0AC8: 1@ = allocate_memory_size 260 // ALLOCATE MEMORY FOR THE CHAT STRING
    SAMP.GetChatString(99, 1@, 2@, 3@, 4@)
    IF
    0AD4: 33@ = scan_string 1@ format "%s is requesting your help." 6@v // 
    THEN 
    IF
    0C18: $NOT_USED = strstr string1 1@ string2 "is requesting your help."
    THEN
    0AD1: "Name: %v" 6@v
    END 
    0AC9: free_allocated_memory 1@ // FREE THE MEMORY
END
END

What's wrong with this script? Why is it crashing?
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,115
Solutions
5
Reaction score
879
Location
Lithuania
1. Format - Name: %s
2.:
Code:
If 
local player spawned 
Then 
Alloc 1@ 260
Alloc 2@ 260
SAMP.GetChatString(99, 1@, 2@, 3@, 4@)
// Do stuff...
End
 
Last edited:

Parazitas

God
Joined
Jan 2, 2017
Messages
3,115
Solutions
5
Reaction score
879
Location
Lithuania
I stoped use SAMPFUNCS , so i can't test , but should work.
PHP:
{$CLEO .cs}

0000: NOP

REPEAT
    WAIT 0
UNTIL 0AFA:  is_samp_available

WHILE TRUE
    WAIT 0
    
IF
0B61: samp is_local_player_spawned 
THEN
    0AC8: 1@ = allocate_memory_size 260
    0AC8: 2@ = allocate_memory_size 260
    SAMP.GetChatString(99, 1@, 2@, 3@, 4@)
    IF
    0AD4: $NOT_USED = scan_string 1@ format "%s is requesting your help." 6@v // 
    THEN 
        IF OR
        0C18: $NOT_USED = strstr string1 1@ string2 "is requesting your help."
        0C29: $NOT_USED = stristr string1 1@ string2 "is requesting your help."
        THEN
            0AD1: "Name: %s" 6@v
        END 
    END
END

END // END WHILE TRUE
 
Status
Not open for further replies.
Top