CLEO Help Auto /pm <id>

CLEO related

qBogdan

Member
Joined
Aug 8, 2019
Messages
17
Reaction score
1
Hello. I need a little help with a cleo mod. I want to make this mod to spam with a deelay the command /pm <id (0-999)> <any text>. In principle, it is easy, but I just can't do it. I want this mode to send a pm with a certain text to all connected players. The SAMP version I use is 0.3.7 R1. Ty
 

dphome

Well-known member
Joined
Mar 21, 2020
Messages
457
Solutions
9
Reaction score
166
Location
Poland
PHP:
{$CLEO .cs}
0000:

REPEAT
    WAIT 100
UNTIL SAMP.Available()
0B34: regcmd "pmall" @cmd

WHILE TRUE
    WAIT 0
END

:cmd
0B35: 0@
0C17: 1@ = 0@
IF 1@ > 1
THEN 0AB1: @pmall 1 0@
END
0B43: cmdret

:pmAll
wait 0
FOR 1@ = 0 TO 999
    IF 0B23:  samp is_player_connected 1@
    THEN 0AF9: "/pm %d %s" 1@ 0@
    END
END
0AB2: ret 0
 

qBogdan

Member
Joined
Aug 8, 2019
Messages
17
Reaction score
1
{$CLEO .cs} 0000: REPEAT WAIT 100 UNTIL SAMP.Available() 0B34: regcmd "pmall" @cmd WHILE TRUE WAIT 0 END :cmd 0B35: 0@ 0C17: 1@ = 0@ IF 1@ > 1 THEN 0AB1: @pmall 1 0@ END 0B43: cmdret :pmAll wait 0 FOR 1@ = 0 TO 999 IF 0B23: samp is_player_connected 1@ THEN 0AF9: "/pm %d %s" 1@ 0@ END END 0AB2: ret 0
It works, but i need deelay for 3 sec... can you help me?
 

alagereric

Member
Joined
Dec 12, 2019
Messages
17
Reaction score
0
Location
Philippines
please comfile it i got error when trying to comfile this one. this is autogetmats but its not working on boar so i added boat x.y postion and when i try to comfile it i got error

{$CLEO}

thread 'BoatGM'
wait 1000
0ac8: 15@ = 260
0ad3: 15@ = "/getmats"

:GetMats
wait 0
if and
Player.Defined($PLAYER_CHAR)
Actor.Driving($PLAYER_ACTOR)
then
if or
00EC: actor $PLAYER_ACTOR sphere 0 near_point 598.1029 -1246.2056 radius 5.0 5.0
00EC: actor $PLAYER_ACTOR sphere 0 near_point 1423.7251 -1320.4540 radius 5.0 5.0
00EC: actor $PLAYER_ACTOR sphere 0 near_point -1713.7140 1348.6115 radius 5.0 5.0
00EC: actor $PLAYER_ACTOR sphere 0 near_point -1495.4771 504.9980 radius 5.0 5.0
00EC: actor $PLAYER_ACTOR sphere 0 near_point 594.6078 -1250.5634 radius 5.0 5.0
00EC: actor $PLAYER_ACTOR sphere 0 near_point 1424.1467 -1319.0349 radius 5.0 5.0
00EC: actor $PLAYER_ACTOR sphere 0 near_point -1816.381 -179.5001 radius 5.0 5.0
00EC: actor $PLAYER_ACTOR sphere 0 near_point 2390.36 -2008.191 radius 5.0 5.0
00EC: actor $PLAYER_ACTOR sphere 0 near_point 2101.62 -104.7528 radius 5.0 5.0
then
0AB1: @SAY 1 15@
end
end
wait 1000
JUMP @GetMats

:SAY
IF 0AA2: 1@ = "samp.dll"
THEN
1@ += 0x65C60 // FUNC_SENDCMD for 0.3.7
0AA5: call 1@ num_param 1 pop 0 0@
END
0AB2: 0
 

dphome

Well-known member
Joined
Mar 21, 2020
Messages
457
Solutions
9
Reaction score
166
Location
Poland
@qBogdan
PHP:
{$CLEO .cs}

0000: NOP

WAIT 8500

0B34: samp register_client_command "pmall" to_label @cmd

WHILE TRUE
WAIT 0
    IF 30@ == 1
    THEN
        FOR 2@ = 0 TO 999
            IF 0B23:  samp is_player_connected 2@
            THEN
                0AF9: samp say_msg "/pm %d %s" 2@ 0@
                //0AD1: show_formatted_text_highpriority "/pm %d %s" time 1337 2@ 0@
                WAIT 4000 // 4 sec.
            END
        END
        30@ = 0
    END
END

:cmd
0B35: samp 0@ = get_last_command_params
0C17: 1@ = strlen 0@
IF 1@ > 1
THEN 30@ = 1
END
0B43: samp cmd_ret
@alagereric
PHP:
{$CLEO .cs}

0000: NOP

WAIT 8500

WHILE TRUE
WAIT 0

IF 0256:   player $PLAYER_CHAR defined
THEN
    IF 00DF:   actor $PLAYER_ACTOR driving
    THEN
        IF OR
        00EC: actor $PLAYER_ACTOR sphere 0 near_point 598.1029 -1246.2056 radius 5.0 5.0
        00EC: actor $PLAYER_ACTOR sphere 0 near_point 1423.7251 -1320.4540 radius 5.0 5.0
        00EC: actor $PLAYER_ACTOR sphere 0 near_point -1713.7140 1348.6115 radius 5.0 5.0
        00EC: actor $PLAYER_ACTOR sphere 0 near_point -1495.4771 504.9980 radius 5.0 5.0
        00EC: actor $PLAYER_ACTOR sphere 0 near_point 594.6078 -1250.5634 radius 5.0 5.0
        THEN
            0AC8: 0@ = allocate_memory_size 1024
            0AD3: 0@ "/getmats"
            0AB1: @SEND_CMD 2 SampVersionID 1 {0.3.7-R1} Text 0@
        END
        IF OR
        00EC: actor $PLAYER_ACTOR sphere 0 near_point 1424.1467 -1319.0349 radius 5.0 5.0
        00EC: actor $PLAYER_ACTOR sphere 0 near_point -1816.381 -179.5001 radius 5.0 5.0
        00EC: actor $PLAYER_ACTOR sphere 0 near_point 2390.36 -2008.191 radius 5.0 5.0
        00EC: actor $PLAYER_ACTOR sphere 0 near_point 2101.62 -104.7528 radius 5.0 5.0
        THEN
            0AC8: 0@ = allocate_memory_size 1024
            0AD3: 0@ "/getmats"
            0AB1: @SEND_CMD 2 SampVersionID 1 {0.3.7-R1} Text 0@
        END        
    END
END

END

:SEND_CMD
// 0AB1: @SEND_CMD 2 SampVersionID 0@ Text 3@
IF 0AA2: 2@ = "samp.dll"
THEN
    IF NOT 0@ < 0
    THEN
        IF 0@ == 1 // 0.3.7 R1
        THEN      
            0A8E: 3@ = 2@ + 0x65C60
            0AA5: call 3@ num_param 1 pop 0 1@
        END
        IF 0@ == 2 // 0.3.7 R2
        THEN      
            0A8E: 3@ = 2@ + 0x65D30
            0AA5: call 3@ num_param 1 pop 0 1@
        END
    
        IF 0@ == 3 // 0.3.DL
        THEN      
            0A8E: 3@ = 2@ + 0x69340
            0AA5: call 3@ num_param 1 pop 0 1@
        END
    
        IF 0@ == 4 // 0.3.7 R3
        THEN       
            0A8E: 3@ = 2@ + 0x69190
            0AA5: call 3@ num_param 1 pop 0 1@
        END
    
        IF 0@ == 5 // 0.3.7 R4
        THEN      
            0A8E: 3@ = 2@ + 0x698C0
            0AA5: call 3@ num_param 1 pop 0 1@
        END
    END
END
0AB2: 0
 

Attachments

  • alagereric.cs
    20 KB · Views: 3
  • qBogdan.cs
    17.9 KB · Views: 9

rinnman

Member
Joined
Jun 4, 2020
Messages
8
Reaction score
0
Location
1233
@qBogdan
PHP:
{$CLEO .cs}

0000: NOP

WAIT 8500

0B34: samp register_client_command "pmall" to_label @cmd

WHILE TRUE
WAIT 0
    IF 30@ == 1
    THEN
        FOR 2@ = 0 TO 999
            IF 0B23:  samp is_player_connected 2@
            THEN
                0AF9: samp say_msg "/pm %d %s" 2@ 0@
                //0AD1: show_formatted_text_highpriority "/pm %d %s" time 1337 2@ 0@
                WAIT 4000 // 4 sec.
            END
        END
        30@ = 0
    END
END

:cmd
0B35: samp 0@ = get_last_command_params
0C17: 1@ = strlen 0@
IF 1@ > 1
THEN 30@ = 1
END
0B43: samp cmd_ret
@alagereric
PHP:
{$CLEO .cs}

0000: NOP

WAIT 8500

WHILE TRUE
WAIT 0

IF 0256:   player $PLAYER_CHAR defined
THEN
    IF 00DF:   actor $PLAYER_ACTOR driving
    THEN
        IF OR
        00EC: actor $PLAYER_ACTOR sphere 0 near_point 598.1029 -1246.2056 radius 5.0 5.0
        00EC: actor $PLAYER_ACTOR sphere 0 near_point 1423.7251 -1320.4540 radius 5.0 5.0
        00EC: actor $PLAYER_ACTOR sphere 0 near_point -1713.7140 1348.6115 radius 5.0 5.0
        00EC: actor $PLAYER_ACTOR sphere 0 near_point -1495.4771 504.9980 radius 5.0 5.0
        00EC: actor $PLAYER_ACTOR sphere 0 near_point 594.6078 -1250.5634 radius 5.0 5.0
        THEN
            0AC8: 0@ = allocate_memory_size 1024
            0AD3: 0@ "/getmats"
            0AB1: @SEND_CMD 2 SampVersionID 1 {0.3.7-R1} Text 0@
        END
        IF OR
        00EC: actor $PLAYER_ACTOR sphere 0 near_point 1424.1467 -1319.0349 radius 5.0 5.0
        00EC: actor $PLAYER_ACTOR sphere 0 near_point -1816.381 -179.5001 radius 5.0 5.0
        00EC: actor $PLAYER_ACTOR sphere 0 near_point 2390.36 -2008.191 radius 5.0 5.0
        00EC: actor $PLAYER_ACTOR sphere 0 near_point 2101.62 -104.7528 radius 5.0 5.0
        THEN
            0AC8: 0@ = allocate_memory_size 1024
            0AD3: 0@ "/getmats"
            0AB1: @SEND_CMD 2 SampVersionID 1 {0.3.7-R1} Text 0@
        END       
    END
END

END

:SEND_CMD
// 0AB1: @SEND_CMD 2 SampVersionID 0@ Text 3@
IF 0AA2: 2@ = "samp.dll"
THEN
    IF NOT 0@ < 0
    THEN
        IF 0@ == 1 // 0.3.7 R1
        THEN     
            0A8E: 3@ = 2@ + 0x65C60
            0AA5: call 3@ num_param 1 pop 0 1@
        END
        IF 0@ == 2 // 0.3.7 R2
        THEN     
            0A8E: 3@ = 2@ + 0x65D30
            0AA5: call 3@ num_param 1 pop 0 1@
        END
   
        IF 0@ == 3 // 0.3.DL
        THEN     
            0A8E: 3@ = 2@ + 0x69340
            0AA5: call 3@ num_param 1 pop 0 1@
        END
   
        IF 0@ == 4 // 0.3.7 R3
        THEN      
            0A8E: 3@ = 2@ + 0x69190
            0AA5: call 3@ num_param 1 pop 0 1@
        END
   
        IF 0@ == 5 // 0.3.7 R4
        THEN     
            0A8E: 3@ = 2@ + 0x698C0
            0AA5: call 3@ num_param 1 pop 0 1@
        END
    END
END
0AB2: 0
Can u make it for 03dl ?
 

dphome

Well-known member
Joined
Mar 21, 2020
Messages
457
Solutions
9
Reaction score
166
Location
Poland
@rinnman
USE: /pmall <text>
Working on 0.3.DL-R1
PHP:
{$CLEO}
0000:

WAIT 8500

0AC8: 0@ = allocate_memory_size 6
0AD3: 0@ = string_format "pmall"
0AC7: 31@ = var 31@ pointer
0AC7: 30@ = var 30@ pointer
0AB1: @registerClientCommand 3 _CommandName 0@ _TogglingVar 30@ _ParamsPtrToVar 31@
31@ = 0
30@ = 0

WHILE TRUE
WAIT 0

IF 30@ <> 0
THEN
    30@ = 0 // disable indication of the cmd
    IF 31@ <> 0 // not null ptr
    THEN 0AD1: "You typed 'pmalll'~n~Params=%s" time 1337 31@
    ELSE 0ACD: "You typed 'pmall'~n~No Params" time 1337
    END        
    FOR 1@ = 0 TO 999
        IF 0AB1: @isPlayerConnected 1 ID 1@
        THEN
            0AC8: 2@ = allocate_memory_size 1024
            0AD3: 2@ "/pm %d %s" 1@ 31@
            0AB1: @SEND_CMD 2 SampVersionID 3 Text 2@        
            0AD1: show_formatted_text_highpriority "~w~%s" time 1337 2@
            0AC9: free_allocated_memory 2@
            WAIT 4000
        END
    END        
END

END

:registerClientCommand
const
    VAR1 = $2AFD
    VAR2 = $2BEC
    VAR3 = $2CDE
    VAR4 = $2DCB
    VAR5 = $2EBF
    VAR6 = $2FAA
end
IF 0AA2: VAR4 = "samp.dll"
THEN
        // ~~~~~~~~~~~~~ Create a New Callback Structure
        {
            51                      // push     ecx
            56                      // push     esi
            8B 74 24 0C             // mov     esi, [esp+0Ch]
            89 34 25 11 11 11 11    // mov     [11111111], esi // later: [11111111] becomes 1@
            83 35 11 11 11 11 01    // xor     [11111111], 01 // later: [11111111] becomes 2@
            5E                      // pop     esi
            59                      // pop     ecx
            C3 // retn
        }
            // Avoid using local variables by saving the values inside a global variables
    008A: VAR1 = 0@
    008A: VAR2 = 2@
    008A: VAR3 = 1@
            //
    0AC8: VAR5 = allocate_memory_size 23 // undeleteable memory region
    0084: VAR6 = VAR5
    0A8C: write_memory VAR6 size 4 value 0x748B5651 virtual_protect 1
    VAR6 += 4
    0A8C: write_memory VAR6 size 4 value 0x34890C24 virtual_protect 1
    VAR6 += 4
    0A8C: write_memory VAR6 size 1 value 0x25 virtual_protect 1
    VAR6++
    // 0A8C: write_memory VAR2 size 4 value 0 virtual_protect 0 // null string // NOT WORKING due to this function's varibles overriding
    0A8C: write_memory VAR6 size 4 value VAR2 virtual_protect 1
    VAR6 += 4
    0A8C: write_memory VAR6 size 2 value 0x3583 virtual_protect 1
    VAR6 += 2
    // 0A8C: write_memory VAR3 size 4 value 0 virtual_protect 0 // Zeroing TogglingVar // NOT WORKING due to this function's varibles overriding
    0A8C: write_memory VAR6 size 4 value VAR3 virtual_protect 1
    VAR6 += 4
    0A8C: write_memory VAR6 size 4 value 0xC3595E01 virtual_protect 1
        // ~~~~~~~~~~~~~ now callback struct VAR5 is ready

    0A8E: VAR6 = VAR4 + 0x2ACA14 // SAMP_CHAT_INPUT_INFO_OFFSET
    0A8D: VAR6 = read_memory VAR6 size 4 virtual_protect 1
    VAR4 += 0x691B0 // SAMP_REGISTER_CLIENT_CMD_OFFSET
    0AA6: call_method VAR4 struct VAR6 num_params 2 pop 0 VAR5 VAR1
END
0AB2: ret 0

:isPlayerConnected
{
    0.3.DL
    IF 0AB1: @isPlayerConnected 1 ID 0@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x2ACA24 // SAMP_INFO_OFFSET       
    0A8D: 30@ = readMem 30@ sz 4 vp 0   
    30@ += 0x3DE // SAMP_PPOOLS_OFFSET              
    0A8D: 30@ = readMem 30@ sz 4 vp 0   
    30@ += 0x8 // SAMP_PPOOL_PLAYER_OFFSET              
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    
    0A8E: 29@ = 31@ + 0x10B0 // SAMP_PLAYER_CONNECTED_OFFSET
                      
    0AA8: call_function_method 29@ struct 30@ num_params 1 pop 0 0@ _Returned: State 28@
    IF 28@ > 0
    THEN 0485:  RETURN_TRUE
    ELSE 059A:  RETURN_FALSE
    END
END
0AB2: 0

:SEND_CMD
// 0AB1: @SEND_CMD 2 SampVersionID 0@ Text 3@
IF 0AA2: 2@ = "samp.dll"
THEN
    IF NOT 0@ < 0
    THEN
        IF 0@ == 1 // 0.3.7 R1
        THEN      
            0A8E: 3@ = 2@ + 0x65C60
            0AA5: call 3@ num_param 1 pop 0 1@
        END
        IF 0@ == 2 // 0.3.7 R2
        THEN      
            0A8E: 3@ = 2@ + 0x65D30
            0AA5: call 3@ num_param 1 pop 0 1@
        END
    
        IF 0@ == 3 // 0.3.DL
        THEN      
            0A8E: 3@ = 2@ + 0x69340
            0AA5: call 3@ num_param 1 pop 0 1@
        END
    
        IF 0@ == 4 // 0.3.7 R3
        THEN       
            0A8E: 3@ = 2@ + 0x69190
            0AA5: call 3@ num_param 1 pop 0 1@
        END
    
        IF 0@ == 5 // 0.3.7 R4
        THEN      
            0A8E: 3@ = 2@ + 0x698C0
            0AA5: call 3@ num_param 1 pop 0 1@
        END
    END
END
0AB2: 0
 

Attachments

  • rinnman.cs
    22.8 KB · Views: 12

petriqqq

Member
Joined
Feb 13, 2022
Messages
16
Reaction score
0
Location
Ma-ta
PHP:
{$CLEO .cs}
0000:

REPEAT
    WAIT 100
UNTIL SAMP.Available()
0B34: regcmd "pmall" @cmd

WHILE TRUE
    WAIT 0
END

:cmd
0B35: 0@
0C17: 1@ = 0@
IF 1@ > 1
THEN 0AB1: @pmall 1 0@
END
0B43: cmdret

:pmAll
wait 0
FOR 1@ = 0 TO 999
    IF 0B23:  samp is_player_connected 1@
    THEN 0AF9: "/pm %d %s" 1@ 0@
    END
END
0AB2: ret 0
Bro sorry, i want to use this too. i am running 0,3,7 r1 and using sampfuncs already. It just crashing me when execute the command
 
Top