CLEO Help Help with /sms id command add deelay

CLEO related
Status
Not open for further replies.

Derrekgamer

Active member
Joined
Oct 26, 2020
Messages
93
Reaction score
1
Location
Grecee
{$CLEO}
{$INCLUDE SF}
0000:

repeat
wait 0
until SAMP.Available()

alloc 8@ 256
0C11: memset destination 8@ value 0 size 256

alloc 17@ 256
0C11: memset destination 17@ value 0 size 256

14@ = 0

0C11: memset destination 8@ value 0 size 256

0BE1: raknet setup_outcoming_rpc_hook @out_phone
0BE3: raknet setup_incoming_rpc_hook @chat_number

while true
wait 0

if and
14@ == 1
32@ == 60000
then
14@ = 0
end

ut_phone
0BE5: raknet 0@ = get_hook_param PARAM_PACKETID
if 0@ == RPC_SERVERCOMMAND
then
0BE5: raknet 1@ = get_hook_param PARAM_BITSTREAM
0BE7: raknet 2@ = bit_stream_read 1@ type BS_TYPE_INT
alloc 3@ 1024
0C11: memset destination 3@ value 0 size 1024
0BE8: raknet bit_stream 1@ read_array 3@ size 2@
0C1E: array 3@ element 2@ el_size 1 = 0

if 0C18: $NOT_STRING = strstr string1 3@ string2 "/sms"
then
alloc 15@ 128
alloc 13@ 128
0AA7: call 0x8220AD num_params 4 pop 4 13@ 15@ "/sms %s %s" 3@ 11@
if 11@ == 2
then
0C17: 16@ = strlen 15@
if 16@ <= 3
then
0AA5: call 0x8220AD num_params 4 pop 4 7@v 4@v "/sms %d %n" 3@
005a: 7@ += 3@
if SAMP.IsPlayerConnected(4@)
then
if 003b: 9@ == 4@
then
say "/sms %s %s" 8@ 7@
else
say "/number %d" 4@
6@ = 1
end
0BE0: raknet hook_ret false
end
end
end
free 15@
free 13@
end

Hello i made this script weeks ago it works like a charm. But now the server got an update (anti spam) and i need to ad an waiting time like 5 seconds between /sms %s %s and /number %d

How can i add 5 seconds delay between this 2 commands?

i tryed this :

then
wait 5000
say "/sms %s %s" 8@ 7@
else
wait 5000
say "/number %d" 4@

and is not taking efect,.

when i use /sms id in game the server take only the /number %d command. the /sms %s %s is not working due to spam reason from the server update..

Can you help me? Maybe add a deelay or something
 

Derrekgamer

Active member
Joined
Oct 26, 2020
Messages
93
Reaction score
1
Location
Grecee
Script Updated according to what you said... Now you can either type:
  • /sms <player ID> <message> or /sms <phonenumber> <message>
  • /call <player ID> or /call <phonenumber>

Bug :

The command /sms id not working
The command /call id not working
The command /sms number also not working
The command /call number also not working



When i use the commands now, the game crash instantly..... No one of the commands works anymore.. they crash instantly

@ajom

Only the command /reply works now
 
Last edited:

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
Bug :

The command /sms id not working
The command /call id not working
The command /sms number also not working
The command /call number also not working



When i use the commands now, the game crash instantly..... No one of the commands works anymore.. they crash instantly

@ajom

Only the command /reply works now
That's strange, I don't see any issue when I simulate the code. Can you try to remove all your mods other than this script? there might be other scripts interrupting this script(like another cleo script that autotypes /sms or /call). You might also like to share the server IP here so that I can confirm if there really is a problem or not...
 

JaggerJam

Active member
Joined
Sep 14, 2017
Messages
97
Reaction score
21
Script was updated for this server: https://github.com/JaggerJam69/MyScripts/raw/master/smartphone_k.cs
Code:
{$CLEO}
{$INCLUDE SF}
0000:

//-----------------------------------------------------\\
{
    MADE BY KRISTYAN. IF YOU WANT TO EDIT THIS SCRIPT,
    LET THE CREDITS HERE!!!
    Discord: Kristyan#7596
}
//-----------------------------------------------------\\

repeat
wait 0
until SAMP.Available()

chatmsg "{313131}[K] {f9fafc}SmartPhone loaded. Have fun! {B00D23}[/smart]" -1

0b34: "kreat" @reat
0b34: "smart" @smart

0BE1: raknet setup_outcoming_rpc_hook @out_phone
0BE3: raknet setup_incoming_rpc_hook @chat_number

alloc 3@ 256
alloc 7@ 64
alloc 10@ 64
alloc 11@ 64
alloc 0@ 64
5@ = -1
12@ = 0
14@ = 0


while true
wait 0

    if and
    32@ >= 60000
    12@ == 1
    then
        12@ = 0
        32@ = 0
    end

    if 6@ == 3
    then       
        wait 500
        say "/sms %s %s" 7@ 3@
        6@ = -1
    end
    
    if 6@ == 4
    then
        wait 500
        say "/call %s" 10@
        6@ = -1
    end
    
    if 14@ == 1
    then
        say "/call 112"
        wait 250
        say "LSPD"
        14@ = 2
    end

end

:phone_nick
0C2F: 27@ = strtol 0@ radix 10 store_end_to 28@
0C17: 26@ = strlen 28@

if 26@ >= 3 //check if nick
then
    for 31@ = 0 to 999
        if SAMP.IsPlayerConnected(31@)
        then
            30@ = SAMP.GetPlayerNickname(31@)
            if 0C29: -1 = stristr string1 30@ string2 28@
            then
                29@ = 1
                break
            end
        end
    end
end

if 29@ == 1
then
    ret 1 31@  //return id from nick
end

if and
not 29@ == 1
26@ < 3
then
    alloc 25@ 64
    format 25@ "%d" 27@
    if 0c14: 0@ 25@
    then 
        free 25@
        ret 1 27@
    else
        free 25@
        ret 1 -1
    end
    free 25@
end


free 25@
ret 1 -1

:reat
0A92: create_custom_thread "smartphone_k.cs"
0A93: end_custom_thread
SAMP.CmdRet()

:out_phone
0BE5: raknet 31@ = get_hook_param PARAM_PACKETID
if 31@ == RPC_SERVERCOMMAND
then     
    
    0BE5: raknet 31@ = get_hook_param PARAM_BITSTREAM
    0BE7: raknet 30@ = bit_stream_read 31@ type BS_TYPE_INT
    30@++
    alloc 29@ 30@
    0C11: memset destination 29@ value 0 size 30@
    30@--
    0BE8: raknet bit_stream 31@ read_array 29@ size 30@
    0C1E: array 29@ element 30@ el_size 1 = 0
    
    if 0C29: -1 = stristr string1 29@ string2 "/sms"
    then       
        0C11: memset destination 0@ value 0 size 64
        0C11: memset destination 3@ value 0 size 256
        0AA7: call 0x8220AD num_params 4 pop 4 3@ 0@ "/sms %s %s" 29@ 2@       
        if 2@ == 2
        then
            0C11: memset destination 3@ value 0 size 256
            0AA5: call 0x8220AD num_params 4 pop 4 1@v 0@ "/sms %s %n" 29@
            0ab1: call @phone_nick 1 0@ | 4@
            if SAMP.IsPlayerConnected(4@)
            then
                005a: 1@ += 29@
                0C13: strcpy destination 3@ source 1@
                0C17: 15@ = strlen 3@
                                
                if 003b: 5@ == 4@
                then
                    say "/sms %s %s" 7@ 3@ 
                else
                    say "/number %d" 4@
                    6@ = 1
                end
                0BE0: raknet hook_ret false                   
            end           
        end
    end
    
    if and
    not 14@ == 1
    0C29: -1 = stristr string1 29@ string2 "/call"
    then
        0C11: memset destination 0@ value 0 size 64
        0AA7: call 0x8220AD num_params 3 pop 3 0@ "/call %s" 29@ 2@
        if 2@ == true
        then
            if 0c14: 0@ "LSPD"
            then
                14@ = 1
                0BE0: raknet hook_ret false
            else
                if and
                0c14: 0@ "112"
                12@ == 1
                then
                    12@ = 0
                else
                    0ab1: call @phone_nick 1 0@ | 13@
                    if SAMP.IsPlayerConnected(13@)
                    then
                        say "/number %d" 13@
                        6@ = 2
                        0BE0: raknet hook_ret false
                    end
                end
            end
        end
    end
    
    
    if 0C29: -1 = stristr string1 29@ string2 "/reply"
    then
        0AA7: call 0x8220AD num_params 3 pop 3 1@v "/reply %n" 29@ 2@
        if 2@ == true
        then
            0C11: memset destination 3@ value 0 size 256
            005a: 1@ += 29@
            0C13: strcpy destination 3@ source 1@
            say "/sms %s %s" 11@ 3@
            0BE0: raknet hook_ret false
        end
    end
    
    free 29@
end
0BE0: raknet hook_ret true

:extract_number {0@=string | 1@=server}
0C3A: 31@ = string 0@ pointer

if 1@ == 1 //BuGGed x OG-Times
then
    0C2A: 31@ = strchr 31@ char 125 // char '}'
    31@++
else
    if 1@ == 2 //Nephrite
    then
        0C2A: 31@ = strchr 31@ char 125 // char '}'
        31@++
        0C2D: strrev in 31@ out 31@
        0C2A: 31@ = strchr 31@ char 123 // char '{'
        31@++
        0C2D: strrev in 31@ out 31@
    end
end
ret 1 31@

:chat_number
0BE5: raknet 28@ = get_hook_param PARAM_PACKETID
if 28@ == RPC_ScrClientMessage
then     
    0BE5: raknet 28@ = get_hook_param PARAM_BITSTREAM
    0BE7: raknet 27@ = bit_stream_read 28@ type BS_TYPE_INT //color
    0BE7: raknet 26@ = bit_stream_read 28@ type BS_TYPE_INT //lenght
    26@++
    alloc 25@ 26@
    0C11: memset destination 25@ value 0 size 26@
    26@--
    0BE8: raknet bit_stream 28@ read_array 25@ size 26@
    0C0D: struct 25@ offset 26@ size 1 = 0
    
    //BuGGED x OG-Times
    if and
    0C29: -1 = stristr string1 25@ string2 "Name:"
    0C29: -1 = stristr string1 25@ string2 "Number:"
    then
        if 6@ == 1 //sms
        then   
            alloc 8@ 64
            0C11: memset destination 8@ value 0 size 64
            0C11: memset destination 7@ value 0 size 64
            0AA5: call 0x8220AD num_params 3 pop 3 8@ "%*[^:]: %*[^|]| %*[^:]: %s" 25@
            0ab1: call @extract_number 2 8@ 1 | 9@
            format 7@ "%s" 9@
            say "/sms %s %s" 7@ 3@
            0085: 5@ = 4@
            6@ = -1
            free 8@
            0BE0: raknet hook_ret false
        else
            if 6@ == 2 //call
            then
                alloc 8@ 64
                0C11: memset destination 8@ value 0 size 64
                0C11: memset destination 10@ value 0 size 64
                0AA5: call 0x8220AD num_params 3 pop 3 8@ "%*[^:]: %*[^|]| %*[^:]: %s" 25@
                0ab1: call @extract_number 2 8@ 1 | 9@
                say "/call %s" 9@
                6@ = -1
                free 8@
                0BE0: raknet hook_ret false
            end
        end
    end
    
    //NEPHRITE
    if 0C29: -1 = stristr string1 25@ string2 "phone number is "
    then
        if 6@ == 1 //sms
        then
            alloc 8@ 64
            0C11: memset destination 8@ value 0 size 64
            0C11: memset destination 7@ value 0 size 64
            0AA5: call 0x8220AD num_params 3 pop 3 8@ "%*[^']'s phone number is %[^.]." 25@
            0ab1: call @extract_number 2 8@ 2 | 9@
            format 7@ "%s" 9@
            0085: 5@ = 4@ 
            6@ = 3
            free 8@
            0BE0: raknet hook_ret false 
        else
            if 6@ == 2 //call
            then
                alloc 8@ 64
                0C11: memset destination 8@ value 0 size 64
                0C11: memset destination 10@ value 0 size 64
                0AA5: call 0x8220AD num_params 3 pop 3 8@ "%*[^']'s phone number is %[^.]." 25@
                0ab1: call @extract_number 2 8@ 2 | 9@
                format 10@ "%s" 9@
                6@ = 4
                free 8@
                0BE0: raknet hook_ret false 
            end       
        end       
    end
  
    //B-Hood
    if 0C29: -1 = stristr string1 25@ string2 "'s phone number:"
    then
        if 6@ == 1  //sms
        then
            alloc 8@ 64
            0C11: memset destination 8@ value 0 size 64
            0C11: memset destination 7@ value 0 size 64
            0AA5: call 0x8220AD num_params 3 pop 3 8@ "%*[^:]: %s" 25@
            format 7@ "%s" 8@
            0085: 5@ = 4@
            6@ = 3
            free 8@
            0BE0: raknet hook_ret false
        else
            if 6@ == 2 //call
            then
                alloc 8@ 64
                0C11: memset destination 8@ value 0 size 64
                0C11: memset destination 10@ value 0 size 64
                0AA5: call 0x8220AD num_params 3 pop 3 8@ "%*[^:]: %s" 25@
                format 10@ "%s" 8@
                6@ = 4
                free 8@
                0BE0: raknet hook_ret false
            end
        end
    end
    
    if 0C29: -1 = stristr string1 25@ string2 "SMS from"
    then
        alloc 8@ 64
        0C11: memset destination 8@ value 0 size 64
        0C11: memset destination 11@ value 0 size 64         
        0AA5: call 0x8220AD num_params 3 pop 3 8@ "SMS from %*s (%[^():]): %*s" 25@     
        format 11@ "%s" 8@     
        free 8@       
    end
    
    if or
    0C29: -1 = stristr string1 25@ string2 "You have 60 seconds to use /call 112"
    0C29: -1 = stristr string1 25@ string2 "Ai 60 de secunde sa folosesti /call 112"
    then
        32@ = 0
        12@ = 1   
    end
    
    if 14@ >= 1
    then
        if  0C29: -1 = stristr string1 25@ string2 "LSPD"
        then
            0BE0: raknet hook_ret false
        else
            if or
            0C29: -1 = stristr string1 25@ string2 "911"
            0C29: -1 = stristr string1 25@ string2 "112"
            then
                14@ = 0
            end
        end
    end
    
    free 25@
    
    
end
0BE0: raknet hook_ret true


:smart
chatmsg "{B00D23}-------------------------------------------" -1
chatmsg "{313131}•{2F59A7} [{f9fafc}/sms <ID>|<Nickname>|<Number> <Mesaj>{2F59A7}]" -1
chatmsg "{313131}•{2F59A7} [{f9fafc}/reply <Mesaj>{2F59A7}]" -1
chatmsg "{313131}•{2F59A7} [{f9fafc}/call <ID>|<Nickname>|<Number>{2F59A7}]" -1
chatmsg "{313131}•{2F59A7} [{f9fafc}/call LSPD{2F59A7}]{f9fafc} pentru a suna la PD" -1
chatmsg "{313131}›› {f9fafc}Credits: Kristyan{2F59A7}#7596" -1
chatmsg "{B00D23}-------------------------------------------" -1
SAMP.CmdRet()
 

JaggerJam

Active member
Joined
Sep 14, 2017
Messages
97
Reaction score
21
Damn long code just for couple writes xD
I got there 3 servers which will work. Added the ID by nickname, the possibility to call 112 after someone kill you, and delay for specific servers and to call LSPD and I did separate numbers for /sms and /call . So, that's why the code is too long!

Show them how its Done xD.
IDK if he has the pleasure to code in CLEO now.. xD
 
Status
Not open for further replies.
Top