CLEO Help activate / dezactivate mod

CLEO related
Status
Not open for further replies.

Derrekgamer

Active member
Joined
Oct 26, 2020
Messages
93
Reaction score
1
Location
Grecee
Hello im trying to make a cleo cmd so that can type in chat every 1 h /wt looking for new members for my clan.. i did it and works perfectly but i cant add the script that enable / disable it. for example : /activate = activate the mod /activate = dezactivate the mod. i tryed this script but when i logging to the server the mod starts by it self and the command has no effect.. Can you help me how to to that so the mod wont work untill i type the command /activate?

My mod :

{$CLEO .cs}
0000: NOP
repeat
wait 50
until 0AFA: is_samp_structures_available


0B34: samp register_client_command "activate" to_label @active

:unknown_6969
WHILE TRUE
WAIT 0
IF 31@ == 1

wait 30000
goto @req
wait 5000
:req
IF 04A4: 15@ == 2
0AF9: samp say_msg "test"
wait 5000
IF 04A4: 15@ == 2
0AF9: samp say_msg "test"
wait 5000
IF 04A4: 15@ == 2
0AF9: samp say_msg "test"
wait 5000
IF 04A4: 15@ == 2
0AF9: samp say_msg "test"
wait 5000
IF 04A4: 15@ == 2
0AF9: samp say_msg "test"
wait 5000
IF 04A4: 15@ == 2
0AF9: samp say_msg "test"
wait 5000
goto @req

:active
0B12: 31@ = 31@ XOR 1
If 31@ == 1
then
0AF8: samp add_message_to_chat "{009900}on" -1
else
0AF8: samp add_message_to_chat "{FF0000}off" -1
end
samp.CmdRet
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
270
Location
Pluto
Hello im trying to make a cleo cmd so that can type in chat every 1 h /wt looking for new members for my clan.. i did it and works perfectly but i cant add the script that enable / disable it. for example : /activate = activate the mod /activate = dezactivate the mod. i tryed this script but when i logging to the server the mod starts by it self and the command has no effect.. Can you help me how to to that so the mod wont work untill i type the command /activate?

My mod :

{$CLEO .cs}
0000: NOP
repeat
wait 50
until 0AFA: is_samp_structures_available


0B34: samp register_client_command "activate" to_label @active

:unknown_6969
WHILE TRUE
WAIT 0
IF 31@ == 1

wait 30000
goto @req
wait 5000
:req
IF 04A4: 15@ == 2
0AF9: samp say_msg "test"
wait 5000
IF 04A4: 15@ == 2
0AF9: samp say_msg "test"
wait 5000
IF 04A4: 15@ == 2
0AF9: samp say_msg "test"
wait 5000
IF 04A4: 15@ == 2
0AF9: samp say_msg "test"
wait 5000
IF 04A4: 15@ == 2
0AF9: samp say_msg "test"
wait 5000
IF 04A4: 15@ == 2
0AF9: samp say_msg "test"
wait 5000
goto @req

:active
0B12: 31@ = 31@ XOR 1
If 31@ == 1
then
0AF8: samp add_message_to_chat "{009900}on" -1
else
0AF8: samp add_message_to_chat "{FF0000}off" -1
end
samp.CmdRet


Cleo Script:
  1. Save as periodicchatter.txt
  2. Open Sanny Builder and Compile it > periodicchatter.cs
  3. Put it at cleo Folder
Code:
{$CLEO .cs}
0000: Priodic Chatter by AJOM
repeat
    wait 50
until 0AFA: is_samp_structures_available

const
    ISENABLED = 31@
    INTERVAL = 30@
    MESSAGE = 29@
end

if 0AAB: file_exists "cleo\periodicchatter.ini"
then
    0AF0: ISENABLED = get_int_from_ini_file "cleo\periodicchatter.ini" section "Settings" key "DefaultEnabled"
    0AF0: INTERVAL = get_int_from_ini_file "cleo\periodicchatter.ini" section "Settings" key "ChatInterval"
    0AF0: MESSAGE = get_int_from_ini_file "cleo\periodicchatter.ini" section "Settings" key "MessageLength"
    MESSAGE++ // Null Terminator
    alloc MESSAGE MESSAGE
    0AF4: MESSAGE = read_string_from_ini_file "cleo\periodicchatter.ini" section "Settings" key "ChatMessage"
else
    ISENABLED = true // default enabled
    INTERVAL = 3600000 // 1 hour
    alloc MESSAGE 42
    0AD3: MESSAGE = format "/wt looking for new members for my clan.."
end

ISENABLED = true // default activated

0B34: samp register_client_command "activate" to_label @active

:mainloop
    if ISENABLED == true
    then 0AF9: samp say_msg MESSAGE
    end

    TIMERA = 0
    while 001D: INTERVAL > TIMERA
        wait 0
    end
jump @mainloop

:active
    0B12: ISENABLED = ISENABLED XOR true
    If ISENABLED == true
    then
        0BDF: resume_thread 0
        0085: TIMERA = INTERVAL // force chat message
        0AF8: samp add_message_to_chat "Periodic-Chatter:{009900}on by AJOM" 0xFFFFFF00
    else
        0BDE: pause_thread 0
        0AF8: samp add_message_to_chat "Periodic-Chatter:{FF0000}off by AJOM" 0xFFFFFF00
    end
samp.CmdRet

Configuration File of the Script:
  1. Save as periodicchatter.ini
  2. put periodicchatter.ini inside the cleo folder
Code:
    ; Settings are Created by AJOM

[Settings]
    ; This is the message that will be sent to chat
ChatMessage=/wt looking for new members for my clan..
    ; Count how many characters are there above and then write it below...
    ; TAKE NOTE: ALWAYS MAKE SURE THAT MESSAGE LENGTH IS GREATER THAN OR EQUAL TO THE LENGTH OF THE MESSAGE ABOVE...
    ; EG. if length of message above is 41, then MessageLength can be 41 or even 53(MessageLength must be >= 41)
MessageLength=41

    ; automatically active the script at startup
DefaultEnabled=1

    ; delay after sending the same chat message
ChatInterval=3600000
 

Derrekgamer

Active member
Joined
Oct 26, 2020
Messages
93
Reaction score
1
Location
Grecee
Cleo Script:
  1. Save as periodicchatter.txt
  2. Open Sanny Builder and Compile it > periodicchatter.cs
  3. Put it at cleo Folder
Code:
{$CLEO .cs}
0000: Priodic Chatter by AJOM
repeat
    wait 50
until 0AFA: is_samp_structures_available

const
    ISENABLED = 31@
    INTERVAL = 30@
    MESSAGE = 29@
end

if 0AAB: file_exists "cleo\periodicchatter.ini"
then
    0AF0: ISENABLED = get_int_from_ini_file "cleo\periodicchatter.ini" section "Settings" key "DefaultEnabled"
    0AF0: INTERVAL = get_int_from_ini_file "cleo\periodicchatter.ini" section "Settings" key "ChatInterval"
    0AF0: MESSAGE = get_int_from_ini_file "cleo\periodicchatter.ini" section "Settings" key "MessageLength"
    MESSAGE++ // Null Terminator
    alloc MESSAGE MESSAGE
    0AF4: MESSAGE = read_string_from_ini_file "cleo\periodicchatter.ini" section "Settings" key "ChatMessage"
else
    ISENABLED = true // default enabled
    INTERVAL = 3600000 // 1 hour
    alloc MESSAGE 42
    0AD3: MESSAGE = format "/wt looking for new members for my clan.."
end

ISENABLED = true // default activated

0B34: samp register_client_command "activate" to_label @active

:mainloop
    if ISENABLED == true
    then 0AF9: samp say_msg MESSAGE
    end

    TIMERA = 0
    while 001D: INTERVAL > TIMERA
        wait 0
    end
jump @mainloop

:active
    0B12: ISENABLED = ISENABLED XOR true
    If ISENABLED == true
    then
        0BDF: resume_thread 0
        0085: TIMERA = INTERVAL // force chat message
        0AF8: samp add_message_to_chat "Periodic-Chatter:{009900}on by AJOM" 0xFFFFFF00
    else
        0BDE: pause_thread 0
        0AF8: samp add_message_to_chat "Periodic-Chatter:{FF0000}off by AJOM" 0xFFFFFF00
    end
samp.CmdRet

Configuration File of the Script:
  1. Save as periodicchatter.ini
  2. put periodicchatter.ini inside the cleo folder
Code:
    ; Settings are Created by AJOM

[Settings]
    ; This is the message that will be sent to chat
ChatMessage=/wt looking for new members for my clan..
    ; Count how many characters are there above and then write it below...
    ; TAKE NOTE: ALWAYS MAKE SURE THAT MESSAGE LENGTH IS GREATER THAN OR EQUAL TO THE LENGTH OF THE MESSAGE ABOVE...
    ; EG. if length of message above is 41, then MessageLength can be 41 or even 53(MessageLength must be >= 41)
MessageLength=41

    ; automatically active the script at startup
DefaultEnabled=1

    ; delay after sending the same chat message
ChatInterval=3600000
 

Attachments

  • image_2020-11-24_024020.png
    image_2020-11-24_024020.png
    121 KB · Views: 10

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
270
Location
Pluto

Replace all the word "TIMERA" into "32@"

You can also uninstall your current Sanny Builder then install the latest version of Sanny builder and SAMPFUNCS
 
Status
Not open for further replies.
Top