-
Posts
14 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
halfastrc's Achievements
Newbie (1/14)
0
Reputation
-
[CLEO] Use a same comamand to desactive and active
halfastrc replied to halfastrc's topic in Help and Discussions
you script DJC work perfectly, thx this will be useful to me Thx, Nic and DJC, you helped me a lot. I just have two more question I have this script too in AHK: F12:: addChatMessage("{32cd32}| INFO |{ffffff} Auto lawyer active!") Loop{ if(RegExMatch(getChatLineEx(),"\QFREEDOM\E(.*)\[(.*)\]", out)){ SendInput {F6}/release %out2%{enter} Sleep,1000 } } return F11:: Reload addChatMessage("{32cd32}| INFO |{ffffff} Auto lawyer desactive!") return } return Basically in this script I use a Regex to take a ID from a determined line of the chat, in the case, the line "FREEDOM" and send a command when this happened. When this happened, automatically the script send the command "/release 1" In .cs is possible do this? (Read a determined chatline and send a command). Click in Dialog: ~ESC:: ~F6:: menu := 0 return PGUP:: SendInput {F6}/prisoner{enter} Sleep,100 menu := 1 return ~LButton:: Time := A_TickCount while(isDialogOpen()){ if (A_TickCount - Time > 500){ return } } checkdialogMenu: if (isDialogButtonSelected() == 1){ menu := 0 } if (menu == 1){ menu := 0 line_num := getDialogLineNumber() line_text := getDialogLine(line_num) if(RegExMatch(line_text,"(.*)\[(.*)\]", out)){ SendInput {F6}/release %out2%{enter} return } } return Basically when I press PGUP the script open a dialog and when click with the mouse in a nick from the list, the script automatically send a command to that ID. For example, if I click in Bemanely[32], automatically the script will send in chat "/release 32", in .cs is possible do this too? I appreciate any help thx -
[CLEO] Use a same comamand to desactive and active
halfastrc replied to halfastrc's topic in Help and Discussions
Thx for the help Actually, I'm try learn more about CLEO cause I made somes scripts cools in AHK (AutoHotkey), but I wanna learn more to move them to .cs. I ask about dialogs cause I wanna do something like this below (to this work it's necessary a SAMP UDF, that leave functions more easy to use) F2:: ShowDialog("1", "{0070ba}Approach", "{bdbdbd}Insert ID player!", "Close") while (!GetKeyState("Enter", "P") && !GetKeyState("Esc", "P") && !GetKeyState("Close", "P")) continue if (GetKeyState("Enter", "P") && ("Fechar", "P")){ sleep 200 chatInput := readString(hGTA, dwSAMP + 0x12D8F8, 256) if (RegExMatch(chatInput, "(\d+)", value)){ return Numpad1:: SendInput {F6}/approach %value%{enter} Sleep,100 return Numpad2:: SendInput {F6}/handcuff %value%{enter} Sleep,100 return Numpad3:: SendInput {F6}/arrest %value%{enter} Sleep,100 return } } return Basically, press F2 open a dialog in the player screen where he's insert a ID in the dialog, and the commands get ready to that ID in Numpad 1, 2 and 3. It's possible do this in .cs? I did something like this in .cs but a little diferent. Basically when I type in chat "/locate 12" the commands get ready to this ID in Numpad1, 2 and 3. {$CLEO .cs} THREAD 'AUTOID' 0B34: samp register_client_command "locate" to_label @IDSET REPEAT WAIT 0 UNTIL 0AFA: 0@ = -1 WHILE TRUE WAIT 0 IF KEY_DOWN 97 // Numpad1 THEN 0AF9: samp say_msg "/approach %d" 0@ WAIT 2025 END IF KEY_DOWN 98 // Numpad2 THEN 0AF9: samp say_msg "/handcuff %d" 0@ WAIT 2025 END IF KEY_DOWN 99 // Numpad3 THEN 0AF9: samp say_msg "/arrest %d" 0@ WAIT 2025 END END :IDSET 0B35: samp 0@ = get_last_command_params IF 0AD4: $NOT_USED = scan 0@ format "%d" 0@ THEN 0AF9: samp say_msg "/locate %d" 0@ ELSE 0AF8: samp add_message_to_chat "Error, use /locate ID" -1 END SAMP.CmdRet() -
[CLEO] Use a same comamand to desactive and active
halfastrc replied to halfastrc's topic in Help and Discussions
Thanks, I undestand a little better how this working and I made two codes to show if is all alright with them. {$CLEO .cs} 0000: NOP REPEAT WAIT 0 UNTIL 0AFA: 0B34: samp register_client_command "hi" to_label @hello WHILE TRUE WAIT 0 END :hello IF 1@ == 0 THEN PRINT "Hello there" 3000 0AF8: samp add_message_to_chat "Test one" -1 WAIT 500 IF 1@ = 1 CMDRET END IF 1@ == 1 THEN PRINT "Thx for the help" 3000 0AF8: samp add_message_to_chat "Test two" -1 WAIT 500 IF 1@ = 0 CMDRET END Using else: {$CLEO .cs} 0000: NOP REPEAT WAIT 0 UNTIL 0AFA: 0B34: samp register_client_command "hi" to_label @hello WHILE TRUE WAIT 0 END :hello IF 1@ == 0 THEN PRINT "Hello there" 3000 0AF8: samp add_message_to_chat "Test one" -1 1@ = 1 WAIT 500 ELSE PRINT "Thx for the help" 3000 0AF8: samp add_message_to_chat "Test two" -1 1@ = 0 WAIT 500 END CMDRET Code two: {$CLEO .cs} 0000: NOP REPEAT WAIT 0 UNTIL 0AFA: WHILE TRUE WAIT 0 IF KEY_DOWN 113 // F2 THEN IF 1@ == 0 THEN PRINT "Hello there" 3000 0AF8: samp add_message_to_chat "Test one" -1 1@ = 1 WAIT 500 ELSE PRINT "Thanks for the help" 3000 0AF8: samp add_message_to_chat "Test two" -1 1@ = 0 WAIT 500 END END END One more question, how can I use output var in CLEO script? For example, I want to show in chat a dialog caption, how can I do it? -
[CLEO] Use a same comamand to desactive and active
halfastrc replied to halfastrc's topic in Help and Discussions
sorry for the inconvenience, but I try train this, and I get crash, do u have any tip of what I need learn, to know more about this? I appreciate any tip {$CLEO .cs} 0000: nop repeat wait 0 until 0afa: 1@ = 0 // what this do and what meaning 1@, it's a var? 0B34: samp register_client_command "msg" to_label @msg :msg if 1@ == 0 then 0AF8: samp add_message_to_chat "Test one" -1 wait 500 1@ = 1 else 0AF8: samp add_message_to_chat "Test two" -1 wait 500 1@ = 0 end cmdret -
[CLEO] Use a same comamand to desactive and active
halfastrc replied to halfastrc's topic in Help and Discussions
Thank so much bro, I'll try learn more about boolean for my scripts Thx ? -
[CLEO] Use a same comamand to desactive and active
halfastrc replied to halfastrc's topic in Help and Discussions
For example, I want to put ON/OFF in my script that have a "While True" This the version that I made, but I got some bugs {$CLEO .cs} 0000: NOP REPEAT WAIT 0 UNTIL 0AFA: 0@ = 0 0B34: samp register_client_command "caixinha" to_label @caixinha :caixinha IF 0@ == 0 0AF8: samp add_message_to_chat "{32cd32}| INFO |{ffffff} Auto Caixinha ativado com sucesso!" -1 //Enable the script WAIT 500 WHILE TRUE WAIT 0 IF 0B4C: samp is_dialog_active -1 THEN 0AC8: 0@ = allocate_memory_size 260 0BD8: samp get_dialog_caption 0@ IF 0C29: $NOT_USED = stristr string1 0@ string2 "SALÁRIO" THEN 0B47: samp close_current_dialog_with_button 0 0AF9: samp say_msg "/caixinha" WAIT 5000 END 0@ = 1 ELSE 0AF8: samp add_message_to_chat "{32cd32}| INFO |{ffffff} Auto Caixinha desativado com sucesso!" -1 // Disable the script WAIT 500 0@ = 0 END END SAMP.CmdRet() And this, is the original version {$CLEO .cs} 0000: NOP REPEAT WAIT 0 UNTIL 0AFA: WHILE TRUE WAIT 0 IF 0B4C: samp is_dialog_active -1 THEN 0AC8: 0@ = allocate_memory_size 260 0BD8: samp get_dialog_caption 0@ IF 0C29: $NOT_USED = stristr string1 0@ string2 "SALÁRIO" THEN 0B47: samp close_current_dialog_with_button 0 0AF9: samp say_msg "/caixinha" WAIT 5000 END END END What I'm doing wrong? Explaining the script, basicaly when a specific dialog come to the player, the script close the dialog and type a message in chat -
Hello there, I'm a novice, and I'm trying learn a little about CLEO script, and I come here again, to ask for help if possible. {$CLEO .cs} 0000: NOP REPEAT WAIT 0 UNTIL 0AFA: 0B34: samp register_client_command "weather" to_label @weatheractive WHILE TRUE WAIT 0 END :weatheractive 01B6: set_weather 8 0AF8: samp add_message_to_chat "{32cd32}You're desactive you weather!" -1 WAIT 1000 SAMP.CmdRet() :weatherdesactive 01B7: release_weather 0AF8: samp add_message_to_chat "{32cd32}You're active you weather!" -1 WAIT 1000 SAMP.CmdRet() This a simple script that I made, and I would to know, if is possible, using the same command "/weather" to jump among the two functions ":weatheractive" and ":weatherdesactive". And if possible explain how can I do, because I would to learn more about this. And thanks so much for the help in the previous scripts ?
-
Thx bro ?
-
halfastrc changed their profile photo
-
Hello there, I've a mod to automatically use a command to Heal. But I would to know, if is possible do a hotkey to Active and Desactive the mod. F2 to active and desactive the mod. I appreciate any help, thanks The Mod: {$CLEO .cs} 0000: NOP repeat wait 0 until 0afa: while true wait 0 if 0B61: samp is_local_player_spawned then 0B2B: samp 0@ = get_player_id_by_actor_handle $PLAYER_ACTOR 0B25: samp 1@ = get_player_health 0@ if 1@ < 50 then say "/heal" while 1@ < 50 wait 0 0B25: samp 1@ = get_player_health 0@ end end end end
-
Thank's, it's something like this, but I got one problem, I would to like say "test" in chat, automatically if the player is next to me. But now, to say "test" in chat, I need type "/cop ID" and the player need near me. For example, I want type in chat "/cop ID" and if the player it's next to me, automatically send in chat "/approach ID" I try do this: {$CLEO .cs} {$USE bitwise} {$USE CLEO+} {$USE file} {$USE ini} {$USE newOpcodes} thread "cop" repeat wait 0 until 0AFA: 0B63: "cop" 0B34: "cop" @cop WHILE TRUE wait 0 if 0@ == 1 then 0@ = 0 if SAMP.IsPlayerConnected(2@) then 10@ = SAMP.GetActorHandleByPlayerID(2@) 11@ = SAMP.GetPlayerColor(2@) if 056D: actor 10@ defined then 00A0: store_actor 10@ position_to 3@ 4@ 5@ 00A0: store_actor $PLAYER_ACTOR position_to 6@ 7@ 8@ 050A: 9@ = distance_between_XYZ 3@ 4@ 5@ and_XYZ 6@ 7@ 8@ if and not 9@ > 10.0 not 11@ == 0xFFAA3333 then 0AFA: samp say_msg "/approach %d end end end end END :cop SAMP.IsCommandTyped(30@) if 0AD4: 1@ = scan_string 30@ format "%d" 2@ then 0@ = 1 else chatmsg "Syntax: /cop <id>" -1 end cmdret I appreciate any help, thanks