CLEO Help Getting Chat String

CLEO related
Status
Not open for further replies.

KamikazeSripterul

Well-known member
Joined
Jun 30, 2019
Messages
353
Reaction score
23
So I tried to make a script in which when the following is been said, it would say the next things in "" but it doesn't work... Can anyone help me please?

Code:
{$CLEO .cs}               
thread "Auto-Clicker"
0000:


repeat
wait 0
until SAMP.Available()

while true
wait 0
    SAMP.GetChatString(1@, 2@, 3@, 4@, 5@)
    alloc 2@ 260
    if or
    0C18: 10@ = strstr string1 2@ string2 "AFK LA PC"
    0C18: 10@ = strstr string1 2@ string2 "BAN PENTRU"
    0C18: 10@ = strstr string1 2@ string2 "AUTOCLICKER"
    0C18: 10@ = strstr string1 2@ string2 "AUTO-CLICKER"
    0C18: 10@ = strstr string1 2@ string2 "ESTI LA PC"
    then
        say "/stopanim"         
        wait 2000
        say "Da, sunt la PC :<."
        wait 1000
        say "/sleep"
    end
    free 2@
end
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
If
Local player spawned
Then
alloc 1@ 260
alloc 2@ 260
SAMP.GetChatString(1@, 2@, 3@, 4@, 5@)
// Do stucc
End
 

KamikazeSripterul

Well-known member
Joined
Jun 30, 2019
Messages
353
Reaction score
23
PHP:
If
Local player spawned
Then
alloc 1@ 260
alloc 2@ 260
SAMP.GetChatString(1@, 2@, 3@, 4@, 5@)
// Do stucc
End
what is the "local player spawned" meant to be as a code? I'm guessing the "do stucc" is the rest of the script from SAMP.GetChatString(1@,2@,3@,4@,5@). Can you explain in a bit more detail please?
 

belle_delphine.py

Active member
Joined
Jul 28, 2019
Messages
46
Reaction score
11
Location
Sibiu
what is the "local player spawned" meant to be as a code? I'm guessing the "do stucc" is the rest of the script from SAMP.GetChatString(1@,2@,3@,4@,5@). Can you explain in a bit more detail please?

1. if you are spawned then the script should run
2. I think he meant you should save the strings in other vars, so each var should contain one of your sentence

again, I don't know cleo very well xd

http://www.cplusplus.com/reference/cstring/strstr/
 
Status
Not open for further replies.
Top