Snippets

This section is only for CLEO Snippet threads. This section is mainly for posting snippets which users can use to develop their own cleo, for example "Draw line snippet". Do not post any releases, help, requests or tutorials&guides threads in this section. If you would like to release a new cleo, visit: >> https://ugbase.eu/releases-6/ If you need to ask for help or help other users about something to do with cleo, visit >> https://ugbase.eu/help-7/ If you would like to request or help to develop a cleo, visit: >> https://ugbase.eu/requests-10/ If you would like to post any Tutorials&Guides threads or learn new things about cleo, visit: >> https://ugbase.eu/tutorials/ Posting different threads which do not have anything to do with...
I want to know what a snippet clearly means. What does it stand for ? Can we use it ?
Here you can send files and they will be decrypted(cleo/lua/ahk) ! CLEO / LUA / AHK files can have their encryption removed In full / in part The SF / ASI / DLL file will be mainly tested It is not possible to extract code in an orderly manner from files programmed in C ++ Here you will find out if a file is safe and what it does.
Code remove all string between characters.. Example.: You have text like: {0000FF}123456{FF00FF}78 You wanna get only: 12345678 So you need use like: {$CLEO} 0000: repeat wait 0 until 0AFA: 0AC8: 0@ = allocate_memory_size 1024 0AD3: 0@ = format "{0000FF}123456{FF00FF}78" 0AC8: 1@ = allocate_memory_size 1024 0AB1: call_scm_func @changeString param_count 4 text 0@ FirstCharacter 123 SecondCharacter 125 memory_to_store_characters_as_text 1@ chatmsg 1@ -1 0A93: end_custom_thread :changeString { 0AB1: call_scm_func @changeString param_count 4 text 0@ FirstCharacter 91 SecondCharacter 93 memory_to_store_characters_as_text 1@ In: 0@ = text , FirstCharacter , SecondCharacter Out: 1@ = pointer to memory where characters...
So i found this code somewhere. the usage is /.spam <delay> <cmd> but if i have a cmd of two words like '/fish start' it doesn't work. it only detects 'fish' and not the 'start'. How do i overcome this?
Like before on the 0.3z version, here you can share updated offset's / structures / infos about samp 0.3.7 RC's. SAMP_INFO_OFFSET - Tested (0.3.7-RC1) (0x688) "samp.dll"+0x215B40 SAMP_INFO_OFFSET + 0x3C8 = RakClientInterface PTR SAMP_CHAT_INFO_OFFSET - Tested (0.3.7-RC1) (0x688) "samp.dll"+0x215B2C "samp.dll"+0x62C10 = FUNC_ADDTOCHATWND cmon kye i'm tired :( Packet ID's (by 0x688): ID_AUTH_KEY = 12 ID_PLAYER_SYNC = 207 ID_AIM_SYNC = 203 ID_VEHICLE_SYNC = 200 ID_STATS_UPDATE = 205 ID_BULLET_SYNC = 206 Structures / Structs SAMP_INFO - Tested (0.3.7-RC1) (povargek) struct stSAMP { #pragma pack( 1 )   uint8_t              byteUnk[0x20];   char              szIP[257];   char              szHostname[255];   void             ...
This took me a while to make... and its really useful for me. 0AB1: @DRAW_OUTLINED_BOX 9 POS 300.0 300.0 SIZE 50.0 50.0 RGBA 255 0 0 255 You can make hacks like this with it: //0AB1: @DRAW_OUTLINED_BOX 9 POS 300.0 300.0 SIZE 50.0 50.0 RGBA 255 0 0 255 THICKNESS 0.5 :DRAW_OUTLINED_BOX 0087: 14@  = 8@ // (float) 0087: 12@ = 2@ // (float) 0087: 13@ = 3@ // (float) 12@ /= 2.0 // (float) 13@ /= 2.0 // (float) 0087: 8@  = 0@ // (float) 005B: 8@ += 2@  // (float) 0063: 8@ -= 12@  // (float) 0087: 9@  = 0@ // (float) 0063: 9@ -= 2@  // (float) 005B: 9@ += 12@  // (float) 0087: 10@ = 1@ // (float) 005B: 10@ += 3@  // (float) 0063: 10@ -= 13@  // (float) 0087: 11@ = 1@ // (float)    by OpcodeXe 0063: 11@ -= 3@  // (float) 005B: 11@ +=...
I just stumped upon Deji's SuperVars and this was mentioned in readme I don't know what exactly it's means  but i make a quick test by trying make 1024 additional vars and found no problem. So, i've decided to share this. Might come in handy for coders. Removing limitations of vars 0A90: 28@ = 4 * 1024 // int 0AC7: 29@ = var 0@ offset            // get the pointer to the last usable variable 0AC8: 30@ = allocate_memory_size 28@ 0A8F: 31@ = 30@ - 29@                // get the offset from variable 0@ to the memory 0016: 31@ /= 4                      // divide by array size to get the index 0085: 28@ = 31@ // (int) 0006: 1@ = 0 0006: 2@ = 0     //fill extra var 0@(31@,4i) - 1023@(31@,4i) for 1@ = 0 to 1023 step 1    0A90: 2@ = 1@ * 2...
Checks if there's any checkpoint active, use as condition(if) //call @is_cp_active 0 Checks if there's any race checkpoint active, use as condition(if) //call @is_racecp_active 0 Gets checkpoint position(XYZ) //call @get_cp_pos 0 X 1@ Y 2@ Z 3@ Gets racecheckpoint position(XYZ) //call @get_racecp_pos 0 X 1@ Y 2@ Z 3@
:hex_to_r_g_b_a //call @hex_to_r_g_b_a 1 color 0xC0FF01FF to R 0@ G 1@ B 2@ A 3@ 0B15: 1@ = 0@ 24 0B10: 1@ = 1@ 0xFF 0B15: 2@ = 0@ 16 0B10: 2@ = 2@ 0xFF 0B15: 3@ = 0@ 8 0B10: 3@ = 3@ 0xFF 0B10: 4@ = 0@ 0xFF 0ab2: ret 4 1@ 2@ 3@ 4@ :r_g_b_a_to_hex //call @r_g_b_a_to_hex 4 R 1@ G 2@ B 3@ A 4@ to_color 5@ 0B16: 5@ = 0@ 24 0B10: 0@ = 5@ 0xFF000000 0B16: 6@ = 1@ 16 0B10: 1@ = 6@ 0x00FF0000 0B16: 7@ = 2@ 8 0B10: 2@ = 7@ 0x0000FF00 0B10: 8@ = 3@ 0x000000FF 005A: 5@ += 6@ 005A: 5@ += 7@ 005a: 5@ += 8@ 0AB2: ret 1 5@
This Snippet Gets the Pedestrian / Car / Object / Building / Particle XYZ Offsets That is Relative to the World XYZ Coordinates. :worldCoordsToEntityOffsets { By Wesser modernized by ajom Description: Convert world coordinates to entity's relative offsets. Passed: 0@ - entity pointer 1@ - position X 2@ - position Y 3@ - position Z Result: 7@ - relative offset X 8@ - relative offset Y 9@ - relative offset Z Example: 0AB1: @worldCoordsToEntityOffsets 4 _entity 0x00000000 _coords_XYZ 0.0 0.0 0.0 _storeoffsets_XYZ 1@ 2@ 3@ } 0@ += 0x14 // CEntity.m_clPlaceable.m_pclMatrix 0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0 0A8E: 4@ = 0@ + 0x30 // CMatrix.m_clOrigin 0AA5: call 0x40FE60 num_params 3 pop 3...
Hi guys, Some camera rotation function by me to get camera rotation because CLEO dosent have it, With this you can make a aim slapper hax :) With set you can do soething IDK but it is currently having problems the set camera rot one and it will eventually change ur keys layout to something like ADSW if u set it like 99.98 Get Camera Rotation :GetCameraRotation 0A8D: 0@ = read_memory 0xB6F178 size 4 virtual_protect 0 0AB2: ret 1 0@ // Call like call @GetCameraRotation 0 4@ Set Camera Rotation :SetCameraRotation 0A8C: write_memory 0xB6F178 size 4 value 0@ virtual_protect 0 0AB2: ret 0 // Call like call @SetCameraRotation 1 4@ + 99.98 Special Weed Effects made by me using this snippet {$CLEO .cs} {$INCLUDE SF} thread "0x32789" 0000...
Snippet deleting files from directory with specified name.. Opcode 0B00: delete_file "CLEO\log.txt" doesn't work with formated text directory. To delete file you can use this snippet.: :DeleteFile { 0AC8: 0@ = allocate_memory_size 1024 0AD3: 0@ = format "cleo\Stop.ini" 0AB1: @DeleteFile 1 File 0@ } if 0AA2: 31@ = load_dynamic_library "Kernel32.dll" then if 0AA4: 30@ = get_dynamic_library_procedure "DeleteFileA" library 31@ then 0AA7: call_function_return 30@ num_params 1 pop 0 0@ _StoreBooleanTo 29@ end 0AA3: free_dynamic_library 31@ end 0AB2: cleo_return 0
i need script "abcdefg hijklmn" divided by space i need "abcdefg" return as 0@ "hijklmn" as 1@ is it possible ?
0C17: 1@ = strlen 0@ 1@ -= 1 0C24: strncpy destination 0@ source 0@ size 1@ This was post by @supahdupahnubah All credits to him. 
100% - Working without SAMPFUNCS Example.: {$CLEO .cs} 0000: NOP WAIT 10000 WHILE TRUE WAIT 0 IF 0AB0: key_pressed 90 {Z} THEN 0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255 WAIT 30 0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0 END END :Set_Virtual_Key { 255 = true 0 = false 0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255 } 2@ = 0xB72CC8 0@ *= 2 005A: 2@ += 0@ // (int) 0A8C: write_memory 2@ size 1 value 1@ virtual_protect 0 0AB2: ret 0 Virtual Game key Snippets.: :Set_Virtual_Key { 255 = true 0 = false 0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255 } 2@ = 0xB72CC8 0@ *= 2 005A: 2@ += 0@ // (int) 0A8C: write_memory 2@ size 1 value 1@ virtual_protect 0 0AB2: ret 0...
Important: from 7/09/2020 update, "HTTP_GET" and "HTTP_POST" have additional parameter called "is_https", which allow it to use https (secure) protocol. So number of parameters in HTTP_GET and HTTP_POST "0AB1: call_scm_func" opcode calls must be updated (now it's 4 for HTTP_GET instead of 3, and it's 5 instead of 4 for HTTP_POST). If you never used this snippet in the past, please ignore this message (because examples below are updated). Code to put inside "Gta/cleo/includes/http_requests.txt": /* Based on the work of: - legend2360 from BlastHack forum https://blast.hk/threads/13410/page-214#post-54339 - AhnMo from github https://gist.github.com/AhnMo/5cf37bbd9a6fa2567f99ac0528eaa185 */ // 0AB1...
Not enough cleo timers? Create/use unlimited number of precise timers with this snippet! Difference between cleo built-in TIMERA/TIMERB and this Snippet: Cleo timers depend on ingame tick, unstable FPS leads to unprecise timer measurements on both TIMERA and TIMERB. This snippets uses your Operating System's Tick Timer as reference to do precise timing measurements. To Increase the number of custom timers, Find(CTRL+F) CustomTimerRegion and add 4 bytes of hex for each new index you create. :GetLapseOfCustomTimer // 0AB1: @GetLapseOfCustomTimer 1 _TimerIndex 0@ _ReturnLapseOfTime 30@ 0AC6: 31@ = label @CustomTimerRegion pointer 0@ *= 4 // 4 bytes for each index 005A: 31@ += 0@ // custom timer index pointer 0A8D: 31@...
Simple copychat with autoresponse Dictionary from which to find word elements = { "Calcium": "Ca", "Hydrogen": "H", "Helium": "He" } most credits to a russian guy, russian are always crazy import pymem, re, example from pymem import Pymem FUNC_SAMP_SENDSAY = 0x57F0 SAMP_FIRST_CHAT_MESSAGE_OFFSET = 0x152 SAMP_CHAT_MESSAGE_SIZE = 0xFC ADDR_SAMP_CHATMSG_PTR = 0x21A0E4 SAMP_MAX_CHAT_MESSAGES = 99 class findproc: def __init__(self) -> None: self.process = Pymem("gta_sa.exe") self.module = pymem.process.module_from_name( self.process.process_handle, "samp.dll" ).lpBaseOfDll def close(self) -> None: self.process.close_process() class API: def __init__(self...
Snippet which allows you to call mouse events. With these functions you can move the Gta Sa Camera. Usually these snippet is used for aimbots and other things.. Originally made by @Opcode.eXe and lost after forum updates.. :MouseMOVE_RIGHT // 0AB1: @MouseMOVE_RIGHT 0 0AA2: 31@ = load_library "user32.dll" 0AA4: 30@ = get_proc_address "mouse_event" library 31@ IF 0A4C: mouse_not_inverted_vertically THEN 0AA5: call 30@ num_params 5 pop 0 0 0 0 -2 0 ELSE 0AA5: call 30@ num_params 5 pop 0 0 0 0 2 0 END 0AA3: free_library 31@ 0AB2: 0 :MouseMOVE_LEFT // 0AB1: @MouseMOVE_LEFT 0 0AA2: 31@ = load_library "user32.dll" 0AA4: 30@ = get_proc_address "mouse_event" library 31@ IF 0A4C: mouse_not_inverted_vertically THEN 0AA5...
This can be used to create scripts that work with various samp versions. In order to use it, I suggest to create "includes" folder inside the "gta_sa/cleo" folder. Then create "get_samp_version.txt" file inside it and paste the code below into it. The code below contains 2 functions: - get_samp_version_id (returning arbitrary number so you can easily compare it in your scripts) - get_samp_version_name /* get_samp_version_id function is reading the "IMAGE_FILE_HEADER" of samp.dll (TimeDateStamp to be specific) That TimeDateStamp is based on compilation time. See this for more info: https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#file-headers "TimeDateStamp = The low 32 bits of the number of seconds...
Example without SAMPFUNCS. For 0.3.DL, works everywhere and easy to change. {$CLEO .cs} {$USE bitwise} 0000: WHILE TRUE WAIT 0 IF 0AB0: is_key_pressed 99 // Numpad 3 THEN 0B12: 31@ = 31@ XOR 1 IF 0039: 31@ == 1 THEN 0AD1: show_formatted_text_highpriority "~r~PBS: ~y~Auta~n~~g~Wlaczone" time 1000 ELSE 0AD1: show_formatted_text_highpriority "~r~PBS: ~y~Auta~n~~r~Wylaczone" time 1000 END WAIT 1000 END IF 31@ == 1 THEN IF 0256: player $PLAYER_CHAR defined THEN 0AC8: 1@ = allocate_memory_size 1024 0AC8: 2@ = allocate_memory_size 1024 0AB1: @getChatString 2 SampVersionID 3 ChatID 99 _Returned: Text 1@ PrefixText 2@ Color 3@ PrefixColor 4@ 0AC8...
Piece of code which allows you to save more numbers without storing them in external files. Edit: Tested and changed into simpler and actually working code alloc 0@ 512 //array pointer 1@ = 0 //buffer 0AB1: @IntArray_Write 3 arrayPointer 0@ index 0 val 123 0AB1: @IntArray_Write 3 arrayPointer 0@ index 1 val 9919 0AB1: @IntArray_Write 3 arrayPointer 0@ index 2 val 77 0AB1: @IntArray_Write 3 arrayPointer 0@ index 3 val 5 0AB1: @IntArray_Write 3 arrayPointer 0@ index 4 val 3661 0AB1: @IntArray_Write 3 arrayPointer 0@ index 5 val 91 0AB1: @IntArray_Write 3 arrayPointer 0@ index 6 val 7255 0AB1: @IntArray_Write 3 arrayPointer 0@ index 7 val 525 0AB1: @IntArray_Read arrayPointer 0@ index 0 _returned 1@ //do something with 1@ which becomes...
You all might not know that this Opcodes actually has a problem modifying the three rotations 0175: set_car 22@ Z_angle_to 315.0 // sets Z-angle to 315.0.... BUT ALSO SETS X-ANGLE AND Y-ANGLE TO 0.0 0731: set_car 34@ y_angle_to 73@ // sets Y-angle to 73@.... BUT ALSO SETS X-ANGLE AND Z-ANGLE TO 0.0 That is why I advise those who are dealing with changing the Car Rotations to use this snippet. This Snippet sets the Car Rotations in XYZ, the original source was posted by woksonal at blast.hk website. But I improved it to becoming more flexible when changing specific plane angle: // Format: // call @SetCarAngles 4 {CarHandle} 0@ {angleX} 1@ {angleY} 2@ {angleZ} 3@ // Usage: // call @SetCarAngles 4 {CarHandle} 15@ {angleX} -1 {angleY} -1...
I noticed that using these Opcodes gives inaccurate rotation values: // Objects: no opcode to get X and Y rotation values 0176: 13@ = object 0@ Z_angle // // Vehicles 077D: 1@ = car 0@ x_angle 06BE: 2@ = car 0@ y_angle 0174: 3@ = car 0@ Z_angle // Luckily, there are Quaternion Opcodes in cleo which gives accurate results: // objects 07C3: get_object 0@ quaternion_to 1@ 2@ 3@ 4@ 07C4: set_object 0@ quaternion_to 1@ 2@ 3@ 4@ // // vehicles 07C5: get_car 0@ quaternion_to 1@ 2@ 3@ 4@ 07C6: set_car 0@ quaternion_to 1@ 2@ 3@ 4@ // So a convertion between Quaternion and 3D-Angles is possible with:
Hello, does anyone have the Gta Sa Keep Window Running memory address? I have found this one on the forum, but it isn't working: 0x747FB6 size 1 value 0x1010101 I am looking for this, but updated:
Top