Wixeek Posted November 14, 2021 Share Posted November 14, 2021 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 More sharing options...
Nic Posted November 14, 2021 Share Posted November 14, 2021 {$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 More sharing options...
Wixeek Posted November 14, 2021 Author Share Posted November 14, 2021 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 More sharing options...
Wixeek Posted November 14, 2021 Author Share Posted November 14, 2021 (edited) 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 Edited November 14, 2021 by Wixeek Link to comment Share on other sites More sharing options...
D J C Posted November 14, 2021 Share Posted November 14, 2021 (edited) @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 November 14, 2021 by D J C Link to comment Share on other sites More sharing options...
Wixeek Posted November 14, 2021 Author Share Posted November 14, 2021 (edited) 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 November 14, 2021 by Wixeek Link to comment Share on other sites More sharing options...
D J C Posted November 14, 2021 Share Posted November 14, 2021 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 More sharing options...
Wixeek Posted November 14, 2021 Author Share Posted November 14, 2021 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 More sharing options...
Wixeek Posted November 14, 2021 Author Share Posted November 14, 2021 yea, fixed the compile error, but the activation command doesnt work on server. Link to comment Share on other sites More sharing options...
D J C Posted November 14, 2021 Share Posted November 14, 2021 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. Link to comment Share on other sites More sharing options...
Wixeek Posted November 14, 2021 Author Share Posted November 14, 2021 (edited) 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 November 14, 2021 by Wixeek Link to comment Share on other sites More sharing options...
Nic Posted November 15, 2021 Share Posted November 15, 2021 (edited) 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 November 15, 2021 by Nic Link to comment Share on other sites More sharing options...
Tupi Posted November 16, 2021 Share Posted November 16, 2021 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 More sharing options...
Nic Posted November 17, 2021 Share Posted November 17, 2021 @Wixeek do you solved the problem? Link to comment Share on other sites More sharing options...
Wixeek Posted November 18, 2021 Author Share Posted November 18, 2021 sorry for my lack of replies i figured it out the script cant read the command by another cleo so i kinda dropped but i will try Nic`s idea with 0C8F: samp process_chat_input "/towcars" ill be back with a response Link to comment Share on other sites More sharing options...
Wixeek Posted November 18, 2021 Author Share Posted November 18, 2021 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 More sharing options...
Wixeek Posted November 18, 2021 Author Share Posted November 18, 2021 (edited) 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 November 18, 2021 by Wixeek Link to comment Share on other sites More sharing options...
Nic Posted November 18, 2021 Share Posted November 18, 2021 (edited) {$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 November 18, 2021 by Nic 1 Link to comment Share on other sites More sharing options...
Wixeek Posted November 18, 2021 Author Share Posted November 18, 2021 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 More sharing options...
Nic Posted November 18, 2021 Share Posted November 18, 2021 Open another topic if you need any more help. Link to comment Share on other sites More sharing options...
Recommended Posts