CLEO Help [REQUEST] CLEO Script

CLEO related
Status
Not open for further replies.

MRS-

New member
Joined
Jun 26, 2016
Messages
1
Reaction score
0
[font=arial, sans-serif]Hello guys, I want to know if I can make a script in Sanny Builder to send messages in SA:MP at a certain time. Can you help me with this script if it exists?[/font]
[font=arial, sans-serif]Thanks! <3[/font]
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
[shcode=cpp]
{$CLEO .cs}
0000:


REPEAT
   WAIT 0
UNTIL 0AFA:  SAMP_IS_READY



WHILE TRUE
   WAIT 0

   IF
   0AB0: 111 {Num /}
   THEN
       IF
       31@ == FALSE
       THEN
       WAIT 500
       0AF8: samp add_message_to_chat "{FFF700}Activated" color 0xFFF700
       31@ = TRUE
       ELSE
       WAIT 500
       0AF8: samp add_message_to_chat "{FFF700}De - activated" color 0xFFF700
       31@ = FALSE
       END
   END
     IF
      31@ == TRUE
       THEN

       say " TEXT 1"
       wait 10000 // 10 seconds to repeat
   END  
           
END
[/shcode]
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
during these 10 seconds the user won't be able to toggle though... It would be better to use 32@ or 33@ timer I think
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
monday said:
during these 10 seconds the user won't be able to toggle though... It would be better to use 32@ or 33@ timer I think

You mean 32@ = 1000 or 33@ = 1000 etc...
wait 32@
wait 33@
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
like this:
Code:
{$CLEO .cs}
0000:
 
 
REPEAT
    WAIT 0
UNTIL 0AFA:  SAMP_IS_READY 

32@ = 0 // 32@ will increase by 1 per each millisecond (33@ works the same, 32@ and 33@ are special variables used for timing)

WHILE TRUE
    WAIT 0
    
    IF 0AB0: 111 {Num /}
    THEN
        IF 31@ == FALSE
        THEN
            WAIT 500
            0AF8: samp add_message_to_chat "{FFF700}Activated" color 0xFFF700
            31@ = TRUE
            
            { here you could also put:
            32@ = 0  //to prevent " TEXT 1" being said at the moment of activation
            32@ = 10000 //to say " TEXT 1" when you activate it
            }
        ELSE
            WAIT 500
            0AF8: samp add_message_to_chat "{FFF700}De - activated" color 0xFFF700
            31@ = FALSE
        END
    END
    
    IF AND 
        31@ == TRUE
        32@ > 10000 // only if 10 seconds have passed
    THEN    
        say " TEXT 1"
        32@ = 0 // reset the timer
    END   
END
this way the timer will increase simultaneously (it won't block the code which checks if button is pressed)
 
Status
Not open for further replies.
Top