CLEO Help Help to put a command.

CLEO related
Status
Not open for further replies.

nighthack031

Member
Joined
May 22, 2020
Messages
8
Reaction score
0
Location
España
Hola, como dice el título, me gustaría poner un comando a este cleo para que el texto del mismo pueda aparecer o desaparecer. Ejemplo del comando / timer. Soy nuevo en Sanny Builder y la verdad es que no se mucho, solo cambio cosas ya escritas por otros, si me ayudas te lo agradecería mucho.


Code:
{$CLEO .cs}
0000: NOP

:Start
wait 100
SAMP.Available
else_jump @Start
0AF8: samp add_message_to_chat "{00C41D}Temporizador de plantación  -  [Creditos: {BB00FF}Corleone{00C41D}]"

THREAD 'TIMER'
0662: printstring "By Corleone"
0662: printstring "SDRP-1"

CONST // TIMERS IN MS
    TIMER1 = 900000
    TIMER2 = 600000
    TIMER3 = 420000
END

REPEAT
    WAIT 0
UNTIL 0AFA:

0B34: samp register_client_command "COCAINA" to_label @CMD1
0B34: samp register_client_command "MARIHUANA" to_label @CMD2
0B34: samp register_client_command "FARMACOS" to_label @CMD3

0B60: convert_game_screen_coords 004.0 439.0 to_window_screen_coords 0@ 1@ // COCAINA COORDS
0B60: convert_game_screen_coords 004.0 429.0 to_window_screen_coords 2@ 3@ // MARIHUANA COORDS
0B60: convert_game_screen_coords 004.0 419.0 to_window_screen_coords 10@ 11@ // FARMACOS COORDS
0B60: convert_game_screen_coords 0.0 6.0 to_window_screen_coords $NOT_USED 4@
0B6D: render 4@ = create_font "Arial black" height 4@ flags 0
5@ = 0xFFF700FF // COCAINA COLOUR
6@ = 0xFF00FF33 // MARIHUANA COLOUR
12@ = 0xFF0FFFD1 // FARMACOS COLOUR
alloc 7@ 256
alloc 8@ 256
alloc 13@ 256

WHILE TRUE
    WAIT 0
    
    // TIMER 1
    IF
        31@ == TRUE
    THEN
        0BFE: 29@ = get_tick_count
        31@ = FALSE
        5@ = 0xFFFF0000 // RED
    END
    IF
        NOT 29@ == 0
    THEN
        0BFE: 30@ = get_tick_count
        0062: 30@ -= 29@ // TIMER MS
        28@ = TIMER1 // TIMER SET MS
        0062: 28@ -= 30@ // TIME REMAINING MS
        0085: 27@ = 28@
        27@ /= 1000
        IF
            28@ <= 0
        THEN
            29@ = 0
            27@ = 0
            5 @ = 0xFFF700FF // VERDE
        FIN
    FIN
    0AD3: 7 @ = formato "COCAINA:% d" 27 @
    
    // TEMPORIZADOR 2
    SI
        26 @ == VERDADERO
    LUEGO
        0BFE: 24 @ = get_tick_count
        26 @ = FALSO
        6 @ = 0xFFFF0000 // ROJO
    FIN
    SI
        NO 24 @ == 0
    LUEGO
        0BFE: 25 @ = get_tick_count
        0062: 25 @ - = 24 @ // TEMPORIZADOR MS
        23 @ = TIMER2 // TIMER SET MS
        0062: 23 @ - = 25 @ // TIEMPO RESTANTE MS
        0085: 22 @ = 23 @
        22 @ / = 1000
        SI
            23 @ <= 0
        LUEGO
            23 @ = 0
            22 @ = 0
            6 @ = 0xFF00FF33 // VERDE
        FIN
    FIN
    0AD3: 8 @ = formato "MARIHUANA:% d" 22 @
    
    // TEMPORIZADOR 3
    SI
        14 @ == VERDADERO
    LUEGO
        0BFE: 15 @ = get_tick_count
        14 @ = FALSO
        12 @ = 0xFFFF0000 // ROJO
    FIN
    SI
        NO 15 @ == 0
    LUEGO
        0BFE: 16 @ = get_tick_count
        0062: 16 @ - = 15 @ // TEMPORIZADOR MS
        17 @ = TIMER3 // TIMER SET MS
        0062: 17 @ - = 16 @ // TIEMPO RESTANTE MS
        0085: 18 @ = 17 @
        18 @ / = 1000
        SI
            17 @ <= 0
        LUEGO
            15 @ = 0
            18 @ = 0
            12 @ = 0xFF0FFFD1 // VERDE
        FIN
    FIN
    0AD3: 13 @ = formato "FARMACOS:% d" 18 @
        
    0B6F: renderizar fuente 4 @ draw_text 7 @ pos 0 @ 1 @ color 5 @ // COCAINA
    0B6F: renderizar fuente 4 @ draw_text 8 @ pos 2 @ 3 @ color 6 @ // MARIHUANA
    0B6F: renderizar fuente 4 @ draw_text 13 @ pos 10 @ 11 @ color 12 @ // FARMACOS
    
FIN

: CMD1
0AF9: samp say_msg "/ COCAINA"
31 @ = VERDADERO
SAMP.CmdRet ()

: CMD2
0AF9: samp say_msg "/ MARIHUANA"
26 @ = VERDADERO
SAMP.CmdRet ()

: CMD3
0AF9: samp say_msg "/ FARMACOS"
14 @ = VERDADERO
SAMP.CmdRet () [/ CODE]
 
Status
Not open for further replies.
Top