CLEO Help Help with the waiting time please !!

CLEO related
Status
Not open for further replies.

Derrekgamer

Active member
Joined
Oct 26, 2020
Messages
93
Reaction score
1
Location
Grecee
{$CLEO}

0662: "CMD"
thread "*Derrek*"
wait 2500
0B34: samp register_client_command "test" to_label @cmd_123


0AB1: call_scm_func @chatmsg 0


:cmd_39
wait 0
jump @cmd_39


//==========================================================

:cmd_123
say "ggsg"
wait 10000
say "fffggsg"
wait 10000
say "134155"
wait 10000
say "24244"
wait 10000
say "244"
wait 10000
say "gagggaf"
wait 10000




:chatmsg
0AA2: 0@ = load_library "samp.dll" // IF and SET
0085: 1@ = 0@ // (int)
1@ += 2203876
0A8D: 3@ = read_memory 1@ size 4 virtual_protect 1
0085: 2@ = 0@ // (int)
2@ += 409616
chatmsg "{D71156}Made !©Derrek!" -1
0AB2: ret 0

Hello ! i made this script, i need a script to say every 2 minutes something in chat up to 5 lines. Need it for my helper rank to the server.

The problem is i can t made the messages white when i use the command test the chat is going spam in 1 sec with all the text it is not waiting..

for example

Hey
wait 10 minutes and say
what s up
whait 10 minutes and say again
good
etc etc.. is there anyway to make an waiting script for every text ? Because they are running all toghether in the same second i tryed everything

p.s i really need the text to be activated by a command or something so i can enable and disable it
 

ajom

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

Fr0z3n

Well-known member
Joined
Nov 20, 2019
Messages
294
Reaction score
36
Location
Srbija
That code is so fucked up xdxd

so first: try to do in while true loop that so example

C++:
0B34: samp register_client_command "toggle" to_label @toggle

while true
    wait 0
    if 30@ == 0 //if you type that command it will change variable to 1
        then
          //do wait stuff
        end
end

:toggle //command
0B12: 30@ = 30@ XOR 1
if 30@ == 1
then
0AF8: samp add_message_to_chat "{46FF00}Turn off!" color 0xFFFFFF
else
0AF8: samp add_message_to_chat "{46FF00}Turn on" color 0xFFFFFF
end
SAMP.CmdRet()
 

Derrekgamer

Active member
Joined
Oct 26, 2020
Messages
93
Reaction score
1
Location
Grecee
That code is so fucked up xdxd

so first: try to do in while true loop that so example

C++:
0B34: samp register_client_command "toggle" to_label @toggle

while true
    wait 0
    if 30@ == 0 //if you type that command it will change variable to 1
        then
          //do wait stuff
        end
end

:toggle //command
0B12: 30@ = 30@ XOR 1
if 30@ == 1
then
0AF8: samp add_message_to_chat "{46FF00}Turn off!" color 0xFFFFFF
else
0AF8: samp add_message_to_chat "{46FF00}Turn on" color 0xFFFFFF
end
SAMP.CmdRet()


ok i understand now but how can i set the time betwen a text and an another text? for example when i log on on the server say: Hello // after 5 minutes say again : heyy

I cant set the waiting time. it spams the chat
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
ok i understand now but how can i set the time betwen a text and an another text? for example when i log on on the server say: Hello // after 5 minutes say again : heyy

I cant set the waiting time. it spams the chat
The first thing you need to do is to Show the Code. We can't exactly point the problem without your reference.
 

Derrekgamer

Active member
Joined
Oct 26, 2020
Messages
93
Reaction score
1
Location
Grecee
The first thing you need to do is to Show the Code. We can't exactly point the problem without your reference.

script :

// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}

//-------------MAIN---------------
0B34: samp register_client_command "toggle" to_label @toggle

while true
wait 5000
if 30@ == 0 //if you type that command it will change variable to 1
then
wait 20000
say "test"
wait 20000
say "test 1"
wait 20000
say "test 2"
wait 20000
end
end

:toggle //command
0B12: 30@ = 30@ XOR 1
if 30@ == 1
then
0AF8: samp add_message_to_chat "{46FF00}Turn off!" color 0xFFFFFF
else
0AF8: samp add_message_to_chat "{46FF00}Turn on" color 0xFFFFFF
end
SAMP.CmdRet()

ok i did the waiting time
now the mod is working without take care about the command "toggle"
how can i add a script if the command /toggle is not typed the mod to do nothing? Because if i use /toggle it says OFF but the mod works anyway

i need somthing like

if 30@ == 0 //if you type that command it will change variable to 1
if false jump @someting and verify again if the command is typed or no..

the waiting time from a text to another text works ! but the on / off is not working


see attachaments
 

Attachments

  • aaaaaaaaaaaaaa.png
    aaaaaaaaaaaaaa.png
    29.2 KB · Views: 8
Last edited:

ajom

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

// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}

//-------------MAIN---------------
0B34: samp register_client_command "toggle" to_label @toggle

while true
wait 5000
if 30@ == 0 //if you type that command it will change variable to 1
then
wait 20000
say "test"
wait 20000
say "test 1"
wait 20000
say "test 2"
wait 20000
end
end

:toggle //command
0B12: 30@ = 30@ XOR 1
if 30@ == 1
then
0AF8: samp add_message_to_chat "{46FF00}Turn off!" color 0xFFFFFF
else
0AF8: samp add_message_to_chat "{46FF00}Turn on" color 0xFFFFFF
end
SAMP.CmdRet()

ok i did the waiting time
now the mod is working without take care about the command "toggle"
how can i add a script if the command /toggle is not typed the mod to do nothing? Because if i use /toggle it says OFF but the mod works anyway

i need somthing like

if 30@ == 0 //if you type that command it will change variable to 1
if false jump @someting and verify again if the command is typed or no..

the waiting time from a text to another text works ! but the on / off is not working


see attachaments
The thing is, the Main Thread(which is the while loop part) will always continue. The way to stop if for the mean to is by Pausing the thread, and resuming it when you turn it on:
Code:
:toggle //command
0B12: 30@ = 30@ XOR 1
if 30@ == 1
then
0BDE: pause_thread 0
0AF8: samp add_message_to_chat "{46FF00}Turn off!" color 0xFFFFFF
else
0BDF: resume_thread 0
0AF8: samp add_message_to_chat "{46FF00}Turn on" color 0xFFFFFF
end
SAMP.CmdRet()




Also what happened on the time you Turned Off the script is that during:
Code:
while true
if 30@ == 0 // OH MY GOD, 30@ is literally 0 so I Will execute this block
then // After I reached this point I don't care if 30@ becomes 0 or 1, I Execute until I reach the "end"
wait 20000 // So I will execute this line
say "test" // So I will execute this line
wait 20000 // During this time 30@ becomes 1, But I dont care since there is no condition for stopping me here, So I will execute this line
say "test 1" // So I will execute this line
wait 20000 // So I will execute this line
say "test 2" // So I will execute this line
wait 20000 // So I will execute this line
end // OK thats it Im done I will not execute this block on the next iteration.
end

You can fix that mess if you do it like this:
Code:
while true
if 30@ == 1
then continue
end

if 30@ == 1
then continue
else wait 20000
end

if 30@ == 1
then continue
else say "test"
end

if 30@ == 1
then continue
else wait 20000
end

if 30@ == 1
then continue
else say "test 1"
end

if 30@ == 1
then continue
else wait 20000
end

if 30@ == 1
then continue
else say "test 2"
end

if 30@ == 1
then continue
else wait 20000
end
end
 

Derrekgamer

Active member
Joined
Oct 26, 2020
Messages
93
Reaction score
1
Location
Grecee
The thing is, the Main Thread(which is the while loop part) will always continue. The way to stop if for the mean to is by Pausing the thread, and resuming it when you turn it on:
Code:
:toggle //command
0B12: 30@ = 30@ XOR 1
if 30@ == 1
then
0BDE: pause_thread 0
0AF8: samp add_message_to_chat "{46FF00}Turn off!" color 0xFFFFFF
else
0BDF: resume_thread 0
0AF8: samp add_message_to_chat "{46FF00}Turn on" color 0xFFFFFF
end
SAMP.CmdRet()




Also what happened on the time you Turned Off the script is that during:
Code:
while true
if 30@ == 0 // OH MY GOD, 30@ is literally 0 so I Will execute this block
then // After I reached this point I don't care if 30@ becomes 0 or 1, I Execute until I reach the "end"
wait 20000 // So I will execute this line
say "test" // So I will execute this line
wait 20000 // During this time 30@ becomes 1, But I dont care since there is no condition for stopping me here, So I will execute this line
say "test 1" // So I will execute this line
wait 20000 // So I will execute this line
say "test 2" // So I will execute this line
wait 20000 // So I will execute this line
end // OK thats it Im done I will not execute this block on the next iteration.
end

You can fix that mess if you do it like this:
Code:
while true
if 30@ == 1
then continue
end

if 30@ == 1
then continue
else wait 20000
end

if 30@ == 1
then continue
else say "test"
end

if 30@ == 1
then continue
else wait 20000
end

if 30@ == 1
then continue
else say "test 1"
end

if 30@ == 1
then continue
else wait 20000
end

if 30@ == 1
then continue
else say "test 2"
end

if 30@ == 1
then continue
else wait 20000
end
end

see that.. what i did wrong?
 

Attachments

  • ggg.png
    ggg.png
    90.3 KB · Views: 5
  • sss.png
    sss.png
    93.4 KB · Views: 5

Derrekgamer

Active member
Joined
Oct 26, 2020
Messages
93
Reaction score
1
Location
Grecee
see that.. what i did wrong?

while true
wait 5000
if 30@ == 0 //if you type that command it will change variable to 1
then
if 30@ == 1
then continue
else say "424342"
end
wait 5000
if 30@ == 1
then continue
else say "test 24312345"
end
wait 5000
if 30@ == 1
then continue
else say "test 2223"
end
wait 5000
if 30@ == 1
then continue
else say "test 2agagrrghhh"
end
wait 5000
if 30@ == 1
then continue
else say "test 2gaag"
end
wait 5000
if 30@ == 1
then continue
else say "test 2fgg"
end
wait 5000
if 30@ == 1
then continue
else say "test "
end
wait 5000
end
end




i did itttt <333333333333333333333 yeeeeeeeeeeeeeeeeeee

im happy :DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD

thanks bro for help

works with this script
 
Status
Not open for further replies.
Top