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 ?
This snippet returns how actor was damaged. Author: @ajom Some changes by: @Parazitas Snippet :isActorDamaged { Use: IF 0AB1: @isActorDamaged 1 ActorHandle: $PLAYER_ACTOR _Returned: DamagedBy 0@ } 0A96: 31@ = actor 0@ struct 0A8E: 30@ = 31@ + 0x760 // DamageID Offset 0A8D: 29@ = read_memory 30@ size 4 virtual_protect 0 IF NOT 29@ == 255 // 255 = not Damaged THEN 0085: 28@ = 29@ // (int) 0A8C: write_memory 30@ size 4 value 255 virtual_protect 0 // clear last damage 0485: return_true 0AB2: ret 1 28@ ELSE 059A: return_false END 0AB2: ret 0 List of Damage types ID's (Slot0: No Weapon) (Slot2: Handguns) 0 – Fist 22 – Pistol 1 – Brass Knuckles...
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.
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@...
Many of you probably C+P'ed the "addClientCommand" out of mod_sa, it's easy to use and has one annoying thing to it.. It is the internal SA:MP limit of commands, you can actually bypass this pretty easy and do your own "command handler" which will also classify you as !337 l33t hax0r. First you need to know how SA:MP handles commands, basically if the input text of the editcontrol on the chatgui contains a "/" it scans through the internal list of commands and if it can't find one it'll send the request to the server. This is where we come in, it's actually pretty easy to go between the call and do your own magic. Today I will present you how, you should have a little experience tho I won't bother explaining everything here. Step one...
:getCollisionBetweenPoints { 0AB1: @getCollisionBetweenPoints 18 from 0@ 1@ 2@ to 3@ 4@ 5@ solid 1 car 1 actor 1 object 1 particle 1 cartyre 1 bikers 0 water 0 DeadPeds 0 see_through 0 camera_objects 0 shoot_through 0 store_to 6@ 7@ 8@ distance_to 9@ entity_to 10@ 0A8E: 11@ = 10@ + 0x36 // 10@ Entity struct 0A8D: 11@ = read_memory 11@ size 1 virtual_protect 0 // entity->m_nStatusType 0B10: 12@ = 11@ AND 7 // 12@ - EntityType EntityType: ENTITY_TYPE_NOTHING = 0 ENTITY_TYPE_BUILDING = 1 ENTITY_TYPE_VEHICLE = 2 ENTITY_TYPE_PED = 3 ENTITY_TYPE_OBJECT = 4 ENTITY_TYPE_DUMMY = 5 ENTITY_TYPE_NOTINPOOLS = 6 } IF 00DF: actor $PLAYER_ACTOR in_car THEN 03C0: 18@ = actor $PLAYER_ACTOR...
:getAimPoint { 0AB1: @getAimPoint 0 _Returned: camera_to 4@ 5@ 6@ point_to 7@ 8@ 9@ } 0470: 31@ = actor $PLAYER_ACTOR current_weapon 31@ *= 0x70 // BLOCK_SIZE_OFFSET 31@ += 0xC8AAB8 // CWEAPON_INFO_OFFSET 31@ += 0x8 // WEAPON_RANGE_OFFSET 0A8D: 31@ = read_memory 31@ size 4 virtual_protect 1 00A0: store_actor $PLAYER_ACTOR position_to 0@ 1@ 2@ // {$4-$6} {$7-$9} {z} {y} {x} {target range} 0AA6: call_method_Find3rdPersonCamTargetVector 0x514970 struct_CCamera 0xB6F028 num_params 6 pop 0 pPoint 0xA49970 pCamera 0xA4997C fOriginZ 2@ fOriginY 1@ fOriginX 0@ fRange 31@ 0AB2: ret 6 $7 $8 $9 $4 $5 $6
:GET_CAMERA_FACING_ANGLES //0AB1: @GET_CAMERA_FACING_ANGLES 0 Z_AND_Y 0@ 1@ 00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@ 0AA6: call_method 0x514970 struct 0xB6F028 num_params 6 pop 0 0xA49994 0xA499A0 3@ 2@ 1@ 20.0 0AB1: call_scm_func @getYAngleBetweenPoints_ULKXK 6 from_XYZ $13 $14 $15 and_XYZ 1@ 2@ 3@ store_to 5@ 0AB1: call_scm_func @getZAngleBetweenPoints_ULKXK 4 from_XY $13 $14 and_XY 1@ 2@ store_to 4@ 5@ += 90.0 0AB2: 2 4@ 5@ :getYAngleBetweenPoints_ULKXK 0509: 6@ = distance_between_XY 0@ 1@ and_XY 3@ 4@ 0063: 2@ -= 5@ 0604: get_Z_angle_for_point 6@ 2@ store_to 7@ 0AB2: ret 1 7@ :getZAngleBetweenPoints_ULKXK 0063: 0@ -= 2@ 0063: 1@ -= 3@ 0604: get_Z_angle_for_point 0@ 1@ store_to 4@ 0AB2: ret 1 4@ By @Opcode.eXe
With these functions you can move the Gta Sa Camera. 0AB1: @MouseMOVE_DOWN 0 0AB1: @MouseMOVE_UP 0 0AB1: @MouseMOVE_LEFT 0 0AB1: @MouseMOVE_RIGHT 0 I already made a Aimbot with these things and its really cool. :MouseMOVE_RIGHT 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 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@...
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...
Top