CLEO Help I Try to make /.spam

CLEO related
Status
Not open for further replies.

ejexter

Well-known member
Joined
Feb 21, 2014
Messages
211
Reaction score
0
I Try to make /.spam <TEXT> <Times>  :computer_guy:
And is crash me!  :angry:
Somebody can explain me what i did wrong?  :yesyes:
Code:
{$CLEO .cs}

0000: NOP
0B34: samp register_client_command ".spam" to_label @start
31@ = 0  // = 0 make it not active

:main
wait 0                                  
if 
  31@ == 1  //check if it is active
jf @main

for 21@ = 0 to "%d" 3@
if 
0AD4: 20@ = scan_string 21@ format "%d" 3@
else_jump @USAGE 
0AF9: samp say_msg "%d" 2@
if
0AD4: 18@ = scan_string 2@ format "%d" 2@
else_jump @USAGE

31@ = 0      //after you finishing your coding , make it = 0 to deactive it  
SAMP.CmdRet
jump @main

:start
wait 0 
   SAMP.IsCommandTyped(0@)
if 
0AD4: 1@ = scan_string 0@ format "%d %d" 2@ 3@
else_jump @USAGE


// here you can do more conditions like:
31@ = 1    // = 1 make it active
SAMP.CmdRet //retrieve the command line
goto @main 

:USAGE
wait 0 
0AF8: samp add_message_to_chat "USAGE: /.spam <Text> <Times>" color 12566463  
31@ = 0   //make it false so  the main label don't start
SAMP.CmdRet //retrieve the command line
goto @main
 

ThermaL

Expert
Joined
Oct 23, 2013
Messages
1,593
Reaction score
3
Code:
{$CLEO .cs}

0000: NOP
0B34: samp register_client_command ".spam" to_label @TRUE
30@ = false

:MAIN 
wait 0
if
30@ == true
jf @MAIN
SAMP.IsCommandTyped(0@)
if 
0AD4: $not_used = scan_string 0@ format "%s %d %d" 1@v 2@ 3@
jf @USAGE
goto @SPAM

:SPAM
wait 3@
if
8039:   31@ == 2@
jf @RESET
0AF9: "%s" 1@v
000A: 31@ += 1
printf "%d/%d" 500 31@ 2@
goto @SPAM

:TRUE
30@ = true
SAMP.CmdRet
goto @MAIN

:USAGE 
0AF8: samp add_message_to_chat "USAGE: /.spam <text> <times> <delay>" color 0xFFFFFF
30@ = false
SAMP.CmdRet
goto @MAIN

:RESET
wait 0
31@ = 0
30@ = false
SAMP.CmdRet
goto @MAIN
Here, you can set the delay between messages too.
 

ejexter

Well-known member
Joined
Feb 21, 2014
Messages
211
Reaction score
0
TH3RM4L link said:
Code:
{$CLEO .cs}

0000: NOP
0B34: samp register_client_command ".spam" to_label @TRUE
30@ = false

:MAIN 
wait 0
if
30@ == true
jf @MAIN
SAMP.IsCommandTyped(0@)
if 
0AD4: $not_used = scan_string 0@ format "%s %d %d" 1@v 2@ 3@
jf @USAGE
goto @SPAM

:SPAM
wait 3@
if
8039:   31@ == 2@
jf @RESET
0AF9: "%s" 1@v
000A: 31@ += 1
printf "%d/%d" 500 31@ 2@
goto @SPAM

:TRUE
30@ = true
SAMP.CmdRet
goto @MAIN

:USAGE 
0AF8: samp add_message_to_chat "USAGE: /.spam <text> <times> <delay>" color 0xFFFFFF
30@ = false
SAMP.CmdRet
goto @MAIN

:RESET
wait 0
31@ = 0
30@ = false
SAMP.CmdRet
goto @MAIN
Here, you can set the delay between messages too.
2mxmpm8.png
?
 

HenryTeylor

Active member
Joined
Sep 13, 2014
Messages
33
Reaction score
0
ejexter link said:

It's my noob code

{$CLEO}
0000:

thread "Henry"

if not 0@ = SAMP.Base()
then 0A93: end_custom_thread
end
while not SAMP.Available()
wait 100
end

0B34: samp register_client_command ".spam" to_label @spam
0B34: samp register_client_command ".spamoff" to_label @spam_off

while true
wait 0
if
4@ == 1
then
0AF9: samp say_msg "%s" 2@v
wait 3@
end
end

:spam
0B35: samp 1@ = get_last_command_params
if
0AD4: 1@ = scan_string 1@ format "%s %d" 2@v 3@
then
4@ = 1
else
0af8: "/.spam [text] [time]" 0xffffff
end
Samp.CmdRet()

:spam_off
4@ = 0
Samp.CmdRet()
 

HenryTeylor

Active member
Joined
Sep 13, 2014
Messages
33
Reaction score
0
ejexter link said:
Same crashing...  :kidding:
+ Someone can post here or send me the sampfuncs functions for cleo??  :youdontsay:

Content folder in the GTA
 

Attachments

  • SF.rar
    142.6 KB · Views: 33

ejexter

Well-known member
Joined
Feb 21, 2014
Messages
211
Reaction score
0
HenryTeylor link said:
Content folder in the GTA
I have a sampfuncs i asked for any other fuctions like:
0AF9: samp say_msg
0B34: samp register_client_command
...
 

m1zg4rd_PL

Well-known member
Joined
Jul 19, 2013
Messages
222
Reaction score
0
Code:
{$CLEO}

thread "Spammer"

:Load
wait 300 
if
  SAMP.Available
else_jump @Load
0B34: samp register_client_command ".spam" to_label @SpamToggle
30@ = 0

while true
  wait 0
  if
    30@ == 1
  then
    0AF9: samp say_msg "%s" 3@v
    wait 2@
  end
end

:SpamToggle
0B35: samp 0@ = get_last_command_params
2@ = -69
0AD4: 29@ = scan_string 0@ format "%d %s" 2@ 3@
if
  2@ == -69
then
  if
    30@ == 0
  then
    0AF8: samp add_message_to_chat "[USAGE]: /.spam <time> <text>" color 0xBEBEBE  
  else
    30@ = 0
    0AF8: samp add_message_to_chat "[.spam] {BE0000}Disabled" color 0xBEBEBE
  end
else
  if
    30@ == 0
  then
    30@ = 1
    0AF8: samp add_message_to_chat "[.spam] {00BE00}Enabled" color 0xBEBEBE
  else
    30@ = 0
    0AF8: samp add_message_to_chat "[.spam] {BE0000}Disabled" color 0xBEBEBE
  end 
end
Samp.CmdRet
 
Status
Not open for further replies.
Top