Jump to content

[CLEO] Timer help


 Share

Recommended Posts

Hi,
I'm starting with CLEO and I have some question / problem.
How to make timer with 5 min countdown on screen whenever This Text show in chat "Total payoff:" when you finish a job i made this code but it full with misstakes i hope someone turn my idea into reality
 

{$CLEO}
{$INCLUDE SF}

0000:

repeat
wait 0
until SAMP.Available()

alloc 29@ 256
0BE3: raknet setup_incoming_rpc_hook @auto_chat

while true 
wait 0

if and
    8B21: samp is_chat_opened
    8C7E:	is_console_active
    then
0@ = FALSE
1@ = 300 // The lenght of the countdown by seconds
1@ *= 1000 // converting it to milliseconds

if
        0ADC:   test_cheat "JOB"
        THEN
            if
            2@ == 0 
            then
                0ACD: show_text_highpriority "AutoJob ~g~ON" time 1000
                018C: play_sound 1083 at 0.0 0.0 0.0
                2@ = 1
                wait 250 
            else
                0ACD: show_text_highpriority "AutoJob ~r~OFF" time 1000
                018C: play_sound 1084 at 0.0 0.0 0.0  
                2@ = 0
                wait 250
            end
        end
    END
    
END

:looperulee
wait 0 
jump @looperulee

:auto_chat
0BE5: raknet 31@ = get_hook_param PARAM_PACKETID
if 31@ == RPC_ScrClientMessage
then 
    0C11: memset destination 29@ value 0 size 256
    
    0BE5: raknet 31@ = get_hook_param PARAM_BITSTREAM
    0BE7: raknet 30@ = bit_stream_read 31@ type BS_TYPE_INT //color
    0BE7: raknet 30@ = bit_stream_read 31@ type BS_TYPE_INT //lenght
    0BE8: raknet bit_stream 31@ read_array 29@ size 30@ //string
    0C0D: struct 29@ offset 30@ size 1 = 0
    end


WHILE TRUE
    WAIT 0
    if or
    0C29: $NULL_STIRNG = stristr string1 29@ string2 "Total payoff:" 
    0C29: $NULL_STIRNG = stristr string1 29@ string2 "Total payoff: $%d"  
    THEN
    if 2@ == 1
        then
        0@ = TRUE
        REPEAT
            WAIT 0
        UNTIL 8AB0:   key_pressed 113
        32@ = 0
    END
    IF
    0@ == TRUE
    THEN
        0085: 2@ = 1@ // (int)
        0085: 3@ = 32@ // (int)
        0062: 3@ -= 2@  // (int)

        3@ /= 1000
        
        3@ *= -1
        0AD1: show_formatted_text_highpriority "TIME_LEFT: %d" time 1000  3@
        
    
    END

    IF AND
    0@ == TRUE
    001D:   32@ > 1@  // (int)
    THEN
        0@ = FALSE
        0AD1: show_formatted_text_highpriority "! GO !" time 2000 0x0AD1
    END

END

 

Edited by LLstylish.NSFW
Link to comment
Share on other sites

@LLstylish.NSFW

 

First of all, the structure of your mode is totally wrong in many ways. Secondly, tell me exactly what you would like to do this way and if I have time I will do it for you.

Edited by Tupi
Link to comment
Share on other sites

Try this if works corectly

{$CLEO}
{$INCLUDE SF}

0000:
repeat
wait 50
until 0AFA:

0BE3: raknet setup_incoming_rpc_hook @RakHookIn
10@ = -1

WHILE TRUE
WAIT 0

if 0AB0: 0x71
then
    if 0@ == 0
    then
        0@ = 1
        print "AutoJob ~g~ON" 1000
    else
        0@ = 0
        print "AutoJob ~r~OFF" 1000
    end
    wait 1000
end

if 10@ > -1
then
    if 10@ > 0
    then printf "TIME LEFT: %d" 1000 10@
    else print "! GO !" 2000
    end
    10@ -= 1
    wait 1000
end


END

:RakHookIn
0BE5: raknet 31@ = get_hook_param PARAM_PACKETID
if 31@ == RPC_ScrClientMessage
then
    0AC8: 27@ = allocate_memory_size 256
    0C11: memset destiantion 27@ value 0 size 256
       
    0BE5: raknet 30@ = get_hook_param PARAM_BITSTREAM
    0BE7: raknet 29@ = bit_stream_read 30@ type BS_TYPE_INT //color
    0BE7: raknet 28@ = bit_stream_read 30@ type BS_TYPE_INT //lenght
    0BE8: raknet bit_stream 30@ read_array 27@ size 28@ //string
    0C0D: struct 27@ offset 28@ size 1 = 0
    
    if 0C29: $NULL_STIRNG = stristr string1 27@ string2 "Total payoff:"
    then 
        if 0@ == 1
        then 10@ = 300
        end
    end
    
    0AC9: free_allocated_memory 27@ 
end
0BE0: raknet hook_ret true

Press F2 for activate/dezactivate the mod.

Link to comment
Share on other sites

~r~    red
~g~    green
~b~    blue
~w~    white
~y~    yellow
~p~    purple
~l~    black
~h~    lighter color

 

Example:

~w~Hello this is ~b~blue ~w~and this is ~r~red

 

Preview: Blueandred.png

 

For more information about these type of color, CLICK

Link to comment
Share on other sites

12 hours ago, LLstylish.NSFW said:

@Tupi  if i want to change the color of the timer to red how i can do it ?

Replace all print messages like this

print "~r~text" 1000

 

Link to comment
Share on other sites

  • D J C locked this topic
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.