CLEO Help I need to be able to do spec for all users

CLEO related

nighthack031

Member
Joined
May 22, 2020
Messages
8
Reaction score
0
Location
España
To do this, try to modify this, being that every x time, use the same cmd but with a different id. My fault is that it just takes the same id all the time. Somebody could help me? I am new at this :/

Code:
{$CLEO .cs}
0000:

repeat
wait 0
until 0AFA:
0B34: samp register_client_command "aspec" to_label @cmd_mycmd


    WHILE TRUE
        WAIT 0
        IF
        30@ == 1
        THEN
            30@ = 0
            0C8A: samp 1@ = get_max_player_id streamed_only 0
            FOR 0@ = 0 TO 1@
            IF
            0B23:  samp is_player_connected 0@
            THEN
                0AF9: "/spec %d" 0@ 5@
                WAIT 1000 // DELAY
                END
            END
        END
    END


:cmd_mycmd
0B35: samp 5@ = get_last_command_params
30@ = 1
0B43: samp cmd_ret
 

Attachments

  • aspec.cs
    17.9 KB · Views: 6

[RP]Foolish

Active member
Joined
Mar 18, 2020
Messages
68
Reaction score
36
Location
sea
try to store the last player spected id
PHP:
{$CLEO .cs}
0000:

repeat
wait 0
until 0AFA:
0B34: samp register_client_command "aspec" to_label @cmd_mycmd

2@ = 0

WHILE TRUE
WAIT 0
    IF 31@ == 1
    THEN
        31@ = 0
        0C8A: samp 0@ = get_max_player_id streamed_only 0
        IF 001D:   2@ > 0@  // (int)
        THEN
            2@ = 0 //reset
        END
        FOR 1@ = 2@ TO 0@
            IF
                0B23:  samp is_player_connected 1@
            THEN
                0AF9: "/spec %d" 1@
                0085: 2@ = 1@ // store last player id
                2@ += 1 // pass to next player id
                WAIT 1000
            END
        END
    END
END


:cmd_mycmd
0B35: samp 5@ = get_last_command_params
30@ = 1
0B43: samp cmd_ret
 
Last edited:
Top