Jump to content
Hostul a fost schimbat. Daca vedeti serverul offline readaugati rpg.b-zone.ro sau 141.95.124.78:7777 in clientul de sa-mp ×

Little help please?


Wixeek
 Share

Recommended Posts

Hello, so im very very noob in any script, but stil i tryed to make a cleo script wich u can activate/deactivate using an command for ex /activation
i want it to type every few seconds a command but it doesnt work or crashes me


 

{$CLEO .cs}
0000:
{$USE bitwise}
{$USE file}
0B34: samp register_client_command "activation" to_label @activation

WHILE TRUE
wait 0
if 0@ == 1
then
    0AF9: say_msg "/towcars" 
end
END

:activation
0B12: 0@ = 0@ XOR 1
if 0@ == 1
then 0AF8: "Spammer on" -1
else 0AF8: "Spammer off" -1
end
0B43: samp cmd_ret
end 

Link to comment
Share on other sites

{$CLEO .cs}

0000: NOP

REPEAT
    WAIT 0
UNTIL 0AFA:

1@ = 0
  
0B34: samp register_client_command "activate" to_label @active


WHILE TRUE   
WAIT 0
    if 1@ == 1  
    then
        say "/towcars"
        wait 3000 // wait 3 seconds (1 second = 1000 ms)
    end
END     

:active
IF 1@ == 0
then
chatmsg "Spammer on" -1
1@ = 1
else
chatmsg "Spammer off" -1
1@ = 0
end
cmdret
Link to comment
Share on other sites

8 minutes ago, Nic said:

{$CLEO .cs}

0000: NOP

REPEAT
    WAIT 0
UNTIL 0AFA:

1@ = 0
  
0B34: samp register_client_command "activate" to_label @active


WHILE TRUE   
WAIT 0
    if 1@ == 1  
    then
        say "/towcars"
        wait 3000 // wait 3 seconds (1 second = 1000 ms)
    end
END     

:active
IF 1@ == 0
then
chatmsg "Spammer on" -1
1@ = 1
else
chatmsg "Spammer off" -1
1@ = 0
end
cmdret

Unknown directive chatmsg "Spammer on" -1
aici trebuie sa mai adaug cv nu?

Link to comment
Share on other sites

So i mananged to make compile it this way, but when i log in i get 3 errors, and after i log and type /active it says the command doesnt exist
any advice?

 

 

 

 

 

{$CLEO .cs}
0000:
REPEAT
WAIT 0
UNTIL 0AFA:
1@ = 0  
0B34: samp register_client_command "Activate" to_label: @active
WHILE TRUE
wait 0
if 0@ == 1
then
0AF9: say_msg "/towcars" 
end
wait 3000    
:active
end
0B43: samp cmd_ret
image.png.40ee5ce9e5678cf39d3218bf8b91a487.png

 

Edited by Wixeek
Link to comment
Share on other sites

@Wixeek Try this out. it might work:

{$CLEO .cs}

0000:
repeat
wait 0
until 0AFA:

0B34: samp register_client_command "activate" to_label @active 

if 8AF7: get_samp_base_to 0@
then 
    0A93: end_custom_thread
end
repeat 
    wait 400
until 0AFA: is_samp_structures_available  

WHILE TRUE   
WAIT 0
    if 1@ == 1  
    then
        say "/towcars"
        wait 3000 // wait 3 seconds (1 second = 1000 ms)
    end
END

:active         
if 1@ == 0 
then
    0ACD: show_text_highpriority "Spammer ~g~ON" time 1000
    018C: play_sound 1083 at 0.0 0.0 0.0
    1@ = 1
    wait 250 
else
    0ACD: show_text_highpriority "Spammer ~r~OFF" time 1000
    018C: play_sound 1084 at 0.0 0.0 0.0  
    1@ = 0
    wait 250
end
SAMP.CmdRet()

 

Btw, I did not test the whole code, if you found bug or smth like that just leave comment below.

Edited by D J C
Link to comment
Share on other sites

10 minutes ago, D J C said:

@Wixeek Try this out. it might work:


{$CLEO .cs}

0000:
repeat
wait 0
until 0AFA:

0B34: samp register_client_command "activate" to_label @active 

if 8AF7: get_samp_base_to 0@
then 
    0A93: end_custom_thread
end
repeat 
    wait 400
until 0AFA: is_samp_structures_available  

WHILE TRUE   
WAIT 0
    if 1@ == 1  
    then
        say "/towcars"
        wait 3000 // wait 3 seconds (1 second = 1000 ms)
    end
END

:active         
if 1@ == 0 
then
    0ACD: show_text_highpriority "Spammer ~g~ON" time 1000
    018C: play_sound 1083 at 0.0 0.0 0.0
    1@ = 1
    wait 250 
else
    0ACD: show_text_highpriority "Spammer ~r~OFF" time 1000
    018C: play_sound 1084 at 0.0 0.0 0.0  
    1@ = 0
    wait 250
end
SAMP.CmdRet()

 

Btw, I did not test the whole code, if you found bug or smth like that just leave comment below.

Label "SAMPCmdRet" not found.
how do i fix this friend
also this
Unknown directive say "/towcars".

Edited by Wixeek
Link to comment
Share on other sites

The only thing that I can say is Apparently, you didn't install sampfuncs or you didn't import their SDK in your Sanny builder folder. I have compiled the whole code right now, and it goes well.

Link to comment
Share on other sites

5 minutes ago, D J C said:

The only thing that I can say is Apparently, you didn't install sampfuncs or you didn't import their SDK in your Sanny builder folder. I have compiled the whole code right now, and it goes well.

hmm weird, ill install it again 

Link to comment
Share on other sites

36 minutes ago, D J C said:

We just debugged the script you wrote at the top, Explain to me what the mod should do in the game?

EX: I want "asd" command and if I used it, appear a text in-game, smth like that.

pretty much for alt accounts to type /towcars every idk 1 or 1 and a half minutes automatically without me doing anything
i have a cleo script when you type /towcars spawn every car you own, and i want it to keep spawning them and keeping them that way.
but still i managed it to work too but looks like /towcars doesnt exist but if i type it it works

Edited by Wixeek
Link to comment
Share on other sites

so /towcars is a command from a mod and you want to type it every x seconds?

If yes try replacing "say" with:

0C8F: samp process_chat_input "/towcars"

Edited by Nic
Link to comment
Share on other sites

Try this

{$CLEO .cs}

0000:
repeat
wait 50
until 0AFA:
0B34: "activation" @activation

WHILE TRUE
wait 0
if 0@ == 1
then
    0AF9: say_msg "/towcars"
    wait 1000
end
END

:activation
if 0@ == 0
then 
       0AF8: "Spammer on" -1
       0@ = 1
else 
       0AF8: "Spammer off" -1
       0@ = 0
end
0B43: samp cmd_ret

 

When script is activated, at every 1 second mod execute /towcars command until you deactivate the mod.

PS: If /towcars command is not from server and is from other mod you can't use this.

Link to comment
Share on other sites

still doesnt work 
using 0C8F: samp process_chat_input "/towcars"
made my chat box dissapear and i couldnt type anything 
i think i will drop this and try to do something to type /towcar ever 1 min or so and go down every time 

Link to comment
Share on other sites

so yea when it types /towcar a dialog pops up and i have to select the car, but i want the script also to press enter to close the dialog, i tryed with 0AB0: key_pressed 13 doesnt work any tips?

should i use this instead?
0B47: samp close_current_dialog_with_button 1 //Ok/Enter

and also how do i make it to press arrow down 

 

 

 

 

{$CLEO .cs}

0000:
repeat
wait 50
until 0AFA:
0B34: "activation" @activation

WHILE TRUE
wait 0
if 0@ == 1
then
    0AF9: say_msg "/towcar"
    0AB0: key_pressed 13
    wait 10000
end
END

:activation
if 0@ == 0
then 
       0AF8: "Spammer on" -1
       0@ = 1
else 
       0AF8: "Spammer off" -1
       0@ = 0
end
0B43: samp cmd_re

Edited by Wixeek
Link to comment
Share on other sites

{$CLEO .cs}

0000:
repeat
wait 50
until 0AFA:
0B34: "activation" @activation

WHILE TRUE
wait 0
if 0@ == 1
then
    0B79: samp set_chat_input_enabled 1    
    0B76: samp set_chat_input_text "towcars"
    0C72: set_virtual_key 13 down true
    0C72: set_virtual_key 13 down false
    
    wait 10000
end
END

:activation
if 0@ == 0
then 
       0AF8: "Spammer on" -1
       0@ = 1
else 
       0AF8: "Spammer off" -1
       0@ = 0
end
0B43: samp cmd_re

You have an "Edit" button, it's not necessary to double/triple post.. It's fine now?

Edited by Nic
Link to comment
Share on other sites

6 minutes ago, Nic said:

{$CLEO .cs}

0000:
repeat
wait 50
until 0AFA:
0B34: "activation" @activation

WHILE TRUE
wait 0
if 0@ == 1
then
    0B79: samp set_chat_input_enabled 1    
    0B76: samp set_chat_input_text "towcars"
    0C72: set_virtual_key 13 down true
    0C72: set_virtual_key 13 down false
    
    wait 10000
end
END

:activation
if 0@ == 0
then 
       0AF8: "Spammer on" -1
       0@ = 1
else 
       0AF8: "Spammer off" -1
       0@ = 0
end
0B43: samp cmd_re

You have an "Edit" button, it's not necessary to double/triple post.. It's fine now?

Sorry about the double post
YES THANK YOU, it works now 

Thank you everyone who helped me learn a bit of cleo you are great tysm

Link to comment
Share on other sites

  • Nic locked this topic
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.