Snippets

Originally posted\made by this sweetie -> @0x688 http://ugbase.eu/Thread-Perfect-crosshair-pos?pid=98743 Output parameters are float Usage : call @crosshair_coords 0 x_out 0@ y_out 1@ :crosshair_coords 0A8D: 23@ = read_memory 0xC9C040 size 4 virtual_protect 0 //x screen 0A8D: 24@ = read_memory 0xC9C044 size 4 virtual_protect 0 //y screen 0A8D: 25@ = read_memory 0xB6EC14 size 4 virtual_protect 0  0A8D: 26@ = read_memory 0xB6EC10 size 4 virtual_protect 0  0093: 22@ = integer 23@ to_float@ 006F: 22@ *= 25@ 0093: 29@ = integer 23@ to_float 29@ *= 0.0015625 29@ *= 64.0 29@ *= 0.2                             29@ *= 0.1 0063: 22@ -= 29@  // (float) /////// 0093: 10@ = integer 24@ to_float 006F: 10@ *= 26@ 0093: 11@ = integer 24@ to_float...
So you wanna edit a vehicle's handling value? Like make a car go faster? With these two snippets you can do it! 0AB1: @GET_HANDLING 3 FROM_VEHICLE_MODEL #SULTAN OFFSET 0x1C SIZE 4 _TO: 0@ //0AB1: @GET_HANDLING 3 FROM_VEHICLE_MODEL #SULTAN OFFSET 0x1C SIZE 4 _TO: 0@ :GET_HANDLING 0@ *= 4 0@ += 0xA9B0C8 0A8D: 0@ 0@ 4 0 0@ += 0x4A 0A8D: 0@ 0@ 2 0 0@ *= 0xE0 0@ += 0xC2B9DC 005A: 0@ 1@ 0A8D: 3@ 0@ 2@ 0 0AB2: 1 3@ 0AB1: @SET_HANDLING 4 FROM_VEHICLE_MODEL #SULTAN OFFSET 0x1C SIZE 4 INTO: -1.0 //0AB1: @SET_HANDLING 4 FROM_VEHICLE_MODEL #SULTAN OFFSET 0x1C SIZE 4 INTO: -1.0 :SET_HANDLING 0@ *= 4 0@ += 0xA9B0C8 0A8D: 0@ 0@ 4 0 0@ += 0x4A 0A8D: 0@ 0@ 2 0 0@ *= 0xE0 0@ += 0xC2B9DC 005A: 0@ 1@ 0A8C: 0@ 2@ 3@ 0 0AB2: 0 Here is a list of all the...
With this snippet you can read out the positions of bones in an actor! Here are the bone-ids: (picture not by me) and heres the function: { GET BONE POSITION: 0AB1: call_scm_func @GET_BONE_POS 2 FROM_ACTOR $PLAYER_ACTOR BONE 6 _STORE_TO 1@ 2@ 3@  // HEAD }    :GET_BONE_POS 0085: 10@ = 0@ // (int) 0085: 15@ = 1@ // (int) 1@ = 0.0 // X offset 2@ = 0.0 // Y offset {THX TO: WESSER} 3@ = 0.0 // Z offset 0A96: 0@ = actor 10@ struct 0AC7: 4@ = var 1@ offset 0AA6: call_method 0x5E01C0 struct 0@ num_params 3 pop 0 bIncludeAnim 1 iBoneID 15@ vOffset 4@ // CPed__getBonePositionWithOffset 0AB2: retn 3 1@ 2@ 3@ Its useful for lot of shits.. like making an Head Aimbot, Esp Hacks, and blabla.. Drawing a line from Head to foot: ok bye
Hey, just dumpin'. float fWindowW = 1024.0f; // input your window width here float fWindowH = 768.0f; // input your window height here float fX = ((fWindowW*(*(float*)0xB6EC14))) - ((fWindowW * 0.0015625f * 64.0f * 0.2f)) * 0.1f; float fY = ((fWindowH*(*(float*)0xB6EC10))) - ((fWindowH * 0.002232143f * 64.0f * 0.2f)) * 0.1f; Sniper is just w/2, h/2. @springfield @monday @€verycleoguy : Could convert this to CLEO and post in the respective section.
Simply, read your chatlog with google translator's voice, it was made by Opcode ! I just release it ! Snippet: :VOICE_SAY_TEXT IF 0AAB:  file_exists "CLEO\downloads\voice.mp3" THEN    0B00: delete_file "CLEO\downloads\voice.mp3" END     0AC8: 2@ = allocate_memory_size 260 0ad3: 2@ = "http:%c%ctranslate.google.com/translate_tts?tl=%s&q=%s" 47 47 1@ 0@ 0D92: 3@ = download_query url 2@ local_file "voice.mp3" REPEAT    WAIT 0        0D93: download_query 3@ get_state_to 4@ UNTIL 4@ == 0 0AAC: 4@ = load_audiostream "CLEO\downloads\voice.mp3" 0AAD: set_mp3 4@ perform_action 1 0AC0: audiostream 4@ loop 0 0ABC: set_audiostream 4@ volume 1.0 REPEAT WAIT 0    0AB9: get_audio_stream_state 4@ store_to 5@ UNTIL 5@ == -1 0AAE: release_mp3 4@...
These are from old mod(s), you should figure out how to use them yourself so it's just a plain dump replace the functions needed and you have nice nametags with weapon icons :0 Ask questions if you have some. If someone gets them working for themselves then don't be shy post it and brag! if (settings.Nametags) {     SAMPHelper::RequestPingUpdates();     void* pPlayerTags = (void*)(*(DWORD*)(dwSAMPBase + 0x21A0B0));     void(__thiscall *CPlayerTags__Draw)(void *_this, CVector *position, char *text, DWORD color, float dist, BYTE unk, int unk1) =         ((void(__thiscall *)(void *_this, CVector *position, char *text, DWORD color, float dist, BYTE renderPause, int unk1))(dwSAMPBase + 0x686C0));     void(__thiscall...
    {$CLEO}     :Noname_02                      /* This snippet has been created by Shanker :) Enjoy RPG.B-Zone.Ro (RO/EN) */     WAIT 0 MS     :Noname_03     WAIT 0 MS     IF NOT SAMP.Available       THEN       JUMP @Noname_03     END          0B34: Create Command "FindTXD" to label @Noname_8130     CHATMSG "Textdraw Finder created by Shanker. Use /FindTXD INT | INT = 0 TO INT" -1     CHATMSG "Enjoy FORUM.B-ZONE.RO THE BIGGEST SAMP COMMUNITY [RO/EN]" -1          var     1@ : int     5@ : int     end          :Noname_04     WAIT 0 MS     JUMP @Noname_04           :Noname_8130     SAMP.IsCommandTyped(0@)     IF 8AD4: NOT 4@ = SCAN 0@ format "%d" 5@        THEN JUMP @ERROR     END        1@ += 1          IF 1@ == 5@           THEN GOTO...
call @SendIncarFakeSpeedSync 4 1@ 2@ 3@ 4@  // 1@ 2@ 3@ are the positions and 4@ being the vehicle id :SendIncarFakeSpeedSync 4@ = SAMP.GetSAMPPlayerIDByActorHandle($PLAYER_ACTOR) 4@ = SAMP.GetPlayerStruct(4@) 4@ += 170 0AC8: 5@ = allocate_memory_size 63 0C10: memcpy destination 5@ source 4@ size 63 0C0D: struct 5@ offset 36 size 4 = 6.0 0C0D: struct 5@ offset 40 size 4 = 6.0 // lower the value if the server has a speed limit on vehicles 0C0D: struct 5@ offset 44 size 4 = 6.0 0B3D: raknet 6@ = new_bit_stream 0B40: raknet bit_stream 6@ write 200 type 0 size 1 0B40: raknet bit_stream 6@ write 5@ type 5 size 63 0B42: raknet send bit_stream 6@ priority 1 reliability 7 ordering_channel 0 0B3E: raknet delete_bit_stream 6@ 0AC9...
The function itself doesn't require sampfuncs but the full example below does {$CLEO .cs} 0000: repeat wait 500 until 0AFA:  is_samp_available alloc 30@ 256 call @Get_Date_Time 0 30@ chatmsg 30@ -1 free 30@ 0A93: end_custom_thread :Get_Date_Time alloc 1@ 30 alloc 4@ 256 0AD3: 4@ = format "nodatefound" 0AA2: 2@ = load_library "kernel32.dll" // IF and SET    if 0AA4: 3@ = get_proc_address "GetLocalTime" library 2@    then    0A8C: write_memory 1@ size 2 value 1 virtual_protect 1    0AA5: call_function 3@ num_params 1 pop 0 1@    //0AC7: 31@ = var 1@ offset    0085: 31@ = 1@ // (int)    0A8D: 20@ = read_memory 31@ size 2 virtual_protect 1    31@ += 2    0A8D: 21@ = read_memory 31@ size 2 virtual_protect 1    31@ += 2  ...
call @SendFakeBulletSync 1 0@ :SendFakeBulletSync 0B20: samp 9@ = actor_handle_by_samp_player_id 0@ 0209: 16@ = 0 52 Actor.StorePos($PLAYER_ACTOR, 10@ 11@ 12@) Actor.StorePos(9@, 13@ 14@ 15@) 0AC8: 5@ = allocate_memory_size 40 0C0D: struct 5@ offset 0 size 1 = 1 0C0D: struct 5@ offset 1 size 2 = 0@ 0C0D: struct 5@ offset 3 size 4 = 10@ 0C0D: struct 5@ offset 7 size 4 = 11@ 0C0D: struct 5@ offset 11 size 4 = 12@ 0C0D: struct 5@ offset 15 size 4 = 13@ 0C0D: struct 5@ offset 19 size 4 = 14@ 0C0D: struct 5@ offset 23 size 4 = 15@ 0C0D: struct 5@ offset 39 size 1 = 16@ 0C0D: struct 5@ offset 27 size 4 = 0.0 0C0D: struct 5@ offset 31 size 4 = 0.0 0C0D: struct 5@ offset 35 size 4 = 0.5  // 0.5 will hit the head, make it 0.0 for the body...
Using this you can draw a line like using 0B68: *I've made this by myself after reading Opcode's post about getting Y/Z angle. *I've tested this and works perfect. Call function: 0AB1: call_scm_func drawLine 9 x1y1 0@ 1@ x2y2 2@ 3@ thickness 1.0 R 255 G 255 B 255 A 255 Function: :drawLine //0AB1: call_scm_func drawLine 9 x1y1 0@ 1@ x2y2 2@ 3@ thickness 1.0 R 255 G 255 B 255 A 255 0390: load_txd_dictionary 'LD_DUAL' 038F: load_texture "white" as 300 0509: 9@ = distance_between_XY 0@ 1@ and_XY 2@ 3@ 0063: 2@ -= 0@ 0063: 3@ -= 1@ 0604: get_Z_angle_for_point 2@ 3@ store_to 10@ 10@ += 90.0 0017: 2@ /= 2.0 0017: 3@ /= 2.0 005B: 0@ += 2@  005B: 1@ += 3@  074B: draw_texture 300 position 0@ 1@ scale 9@ 4@ angle 10@ color_RGBA 5@ 6@ 7@ 8@...
call @SendOnFootFakeSpeedSync 3 1@ 2@ 3@ :SendOnFootFakeSpeedSync 3@ = SAMP.GetSAMPPlayerIDByActorHandle($PLAYER_ACTOR) 3@ = SAMP.GetPlayerStruct(3@) 3@ += 109 0AC8: 4@ = allocate_memory_size 68 0C10: memcpy destination 4@ source 3@ size 68 0C0D: 4@ 38 4 = 6.0 0C0D: 4@ 42 4 = 6.0 0C0D: 4@ 46 4 = 6.0 0B3D: raknet 5@ = new_bit_stream RakNet.Write(5@, 207, 0, 1) RakNet.Write(5@, 4@, 5, 68) 0B8B: raknet send bit_stream 5@ 0B3E: raknet delete_bit_stream 5@ 0AC9: free_allocated_memory 4@ 0AB2: ret 0 Will send fake onfoot velocity of the player to the server  :trollface:
{$CLEO .cs} 0000: 0662: NOP "#########################" 0662: NOP "___Made by Opcode.eXe___"  { BASIC THREAD } 0662: NOP "Www.Youtube.Com/OpcodeXe" 0662: NOP "#########################" 0AB1: call_scm_func @RUN_CLEO_MOD 1 AT LINE cLeo WHILE TRUE     wait 0     if     0AB0: 49 // X     then         0AD1: show_formatted_text_highpriority "CLEO THREAD_1 IS RUNNING! %d" time 1 33@     end END :CLEO 0000: WHILE TRUE     wait 0     if     0AB0: 50 // X     then         0AD1: show_formatted_text_highpriority "CLEO THREAD_2 IS RUNNING! %d" time 1 33@     end END :RUN_CLEO 0A9F: 32@ = current_thread_pointer 000A: 32@ += 0x10 0A8D: 32@ = read_memory 32@ size 4 virtual_protect 0 0062: 32@ -= 0@ 0AA7: call_function 0x464C20 num_params...
Sets a new position and size of the minimized gta_sa window handle. ( I need it for my AntiAfk :D ) 0AB1: @SET_WINDOW_POS_AND_SIZE 4 pos_x 50 pos_y 40 width 400 width 400 :SET_WINDOW_POS_AND_SIZE 0A8D: 31@ = 0xC9C060 4 0 IF 31@ == TRUE THEN       0AA2: 30@ = load_library "User32.dll"       0AA4: 29@ = get_proc_address "MoveWindow" library 30@       0A8D: 28@ = 0xC97C1C 4 0       0AA7: call_function 29@ params 6 pop 0 TRUE 3@ 2@ 1@ 0@ 28@ 29@  END 0AB2: 0
Just a lil dump for me and other people ;) Anti Carjack (0x688): samp.dll + 0x12AE0 set first 3 bytes to 0xC2 0x08 0x08 or NOP 5 bytes from samp.dll + 0x12B77. [hr] Disable Chat Rendering (0x688): samp.dll + 0x64230 set first byte to 0xC3 [hr] Chat Stuff (0x688): samp.dll + 0x21A0E4 = chatclass ptr chatclass + 0x132 = array of chat "messages" (a struct containing various informations) thoughts: the array has a total size of 25286 bytes if we take now an internal limit from the rendering loop (100) and divide it the sum is 252 bytes = one entry has 252 bytes (0xFC) Not finished struct: struct chatmsg { int unk; //0x0 char unk1[28]; //0x4 char msg[144]; //0x20 char unk3[64]; //0xB0 int sometype; //0xF0 DWORD color...
With this function you can draw gradient bars, as the title says. You must be careful to the "value", which musn't be higher than 100.0, or it will fail. Just a little example of how it works: 0AB1: call_scm_func @drawGradientBar 11 position 320.0 224.0 size 56.0 6.0 value 100.0 RR 0.0 0.0 GG 100.0 155.0 BB 155.0 255.0 This will draw a full bar (100.0/100.0) from 320.0 to 376.0 ( size 56.0). The initial green value (for value == 0.0) is 100.0 and the final one (for value == 100.0) is 155.0. Same from blue, just from 155.0 to 255.0. :drawGradientBar //0AB1: call_scm_func @drawGradientBar 11 position 320.0 224.0 size 56.0 6.0 value 100.0 RR 0.0 0.0 GG 100.0 155.0 BB 155.0 255.0 0087: 12@ = 2@ 0017: 12@ /= 100.0 0087: 13@ = 6@ 0063...
Memory Addresses Ok, so one thing before we start: *please add more addresses when you find; Now, what I found and I think would be interesting: [2]0x58DB60 - get current wanted on MP //PopandauL [1]0xC7DEEA - is any checkpoint active (3rd checkpoint in the pool) //PopandauL [4]0x859014 - changes the value of how deep you can fall down the map //Opcode.eXe [4]0xB7CDB4 - sprinting time left //springfield [4]0xB7CDE0 - breathing time left //springfield [1]0x747FB6 - 0x1010101/ 0 - gta sa keep window //Opcode.eXe [1]0x74805A - 0x1010101/ 0 - cursor running //Opcode.eXe [8]0x74542B - 0x6F6F6F70/ 0x5051FF15 - no game pausing //Opcode.eXe [1]0xB7CD98 -+0x474 - make ped visible (4) or invisible (6) //springfield
//0AB1: @CREATE_VELOCITY_IN_LOOKING_DIRECTION 1 POWER 1.0 _STORE_TO 4@ 5@ 6@ :CREATE_VELOCITY_IN_LOOKING_DIRECTION 0087: 13@ = 0@ // (float) Actor.StorePos($PLAYER_ACTOR, 20@, 21@, 22@) 068D: get_camera_position_to 24@ 25@ 26@ 0063: 20@ -= 24@ // (float) 0063: 21@ -= 25@ // (float) 0063: 22@ -= 26@ // (float) Actor.StorePos($PLAYER_ACTOR, 0@, 1@, 2@) 006B: 20@ *= 13@ // (float) 006B: 21@ *= 13@ // (float) 006B: 22@ *= 13@ // (float) 005B: 22@ += 13@ // (float) 005B: 0@ += 20@ // (float) 005B: 1@ += 21@ // (float) 005B: 2@ += 22@ // (float) Actor.StorePos($PLAYER_ACTOR, 3@, 4@, 5@) 0063: 0@ -= 3@ // (float) 0063: 1@ -= 4@ // (float) 0063: 2@ -= 5@ // (float) 0AB2: RET 3 0@ 1@ 2@ Heres an example of this: ( Veeery simple...
call @SendInCarPosSync 3 1@ 2@ 3@ :SendInCarPosSync                3@ = SAMP.GetSAMPPlayerIDByActorHandle($PLAYER_ACTOR) 3@ = SAMP.GetPlayerStruct(3@) 3@ += 170 0AC8: 4@ = allocate_memory_size 63 0C10: memcpy destination 4@ source 3@ size 63 0C0D: struct 4@ offset 24 size 4 = 0@ 0C0D: struct 4@ offset 28 size 4 = 1@ 0C0D: struct 4@ offset 32 size 4 = 2@ 0B3D: raknet 5@ = new_bit_stream RakNet.Write(5@, 200, BS_TYPE_BYTE, 1) RakNet.Write(5@, 4@, BS_TYPE_ARRAY, 63) 0B8B: raknet send bit_stream 5@                0B3E: raknet delete_bit_stream 5@ 0AC9: 4@ 0AB2: ret 0 This will send your desirable in car position, making server believe that you're actually there without being there o.O  :trollface: Thanks to springfield...
{ EXAMPLE: 0@ = CAR_HANDLE 0AB1: @SYNC_INN 1 HANDLE 0@ WAIT 0 0224: set_car 0@ health_to 0 WAIT 0 0AB1: @SYNC_OUT 0 - YOU HAVE TO BE ONFOOT. } //0AB1: @SYNC_INN 1 HANDLE 0@ :SYNC_INN 0A97: 2@ = car 0@ struct 0A96: 3@ = actor $PLAYER_ACTOR struct 3@ += 1328 0A8C: write_mememory 3@ size 4 value 50 virtual_protect 0 0A96: 3@ = actor $PLAYER_ACTOR struct 3@ += 1420 0A8C: write_mememory 3@ size 4 value 2@ virtual_protect 0 0AB2: ret 0 //0AB1: @SYNC_OUT 0 :SYNC_OUT 0A96: 0@ = actor $PLAYER_ACTOR struct 0@ += 0x530 // State = 0, leaving car 0A8C: write_mememory 0@ size 4 value 1 virtual_protect 0  0AB2: ret 0
You just have to enter the marker ID, but on most servers you only have one active. I've also used this for my teleporter like you can see below. *By marker I mean the red checkpoint... for 13@ = 0 to 31     if 0AB1: @GetMarkerPosition 1 13@ 14@ 15@ 16@     then     Actor.PutAt($PLAYER_ACTOR,14@,15@,16@)     end end Call function: if 0AB1: @GetMarkerPosition 1 ID 0@ X 1@ Y 2@ Z 3@ then wait 0 end Function: :GetMarkerPosition 0@ *= 0xA0 0@ += 0xC7DD58 0@ += 0x30      0A8D: 1@ = read_memory 0@ size 4 virtual_protect 0 // X 0@ += 0x4 0A8D: 2@ = read_memory 0@ size 4 virtual_protect 0 // Y 0@ += 0x4 0A8D: 3@ = read_memory 0@ size 4 virtual_protect 0 // Z 0@ += 0x1A 0A8D: 4@ = read_memory 0@ size 1 virtual_protect 0 // ACTIVE     if and...
Hi, I just made/edited a little script to get the aiming position of the crosshair. Use GOSUB @GET_AIMING_POS to get the aiming cordinates. It will store the cordinates to 0@ 1@ 2. Heres an example wich creates a explosion at the aiming position if you rightclick: {$CLEO .cs} THREAD "AIM_EXPLOSION" 0662: NOP "www.youtube.com/OpcodeXe" 0662: NOP "www.ugbase.eu" :START wait 10 if 0AB0: KEY_PRESSING: 2 // RIGHT MOUSE BUTTON - AIMING jf @START GOSUB @GET_AIMING_POS // RETURNS AIMING AT POSITION TO: 0@ 1@ 2@ 020C: create_explosion_with_radius 3 at 0@ 1@ 2@ Jump @START :GET_AIMING_POS // PASTE THIS AT THE END OF THE SCRIPT Actor.StorePos($PLAYER_ACTOR, 1@, 2@, 3@) 0A9F: 5@ = current_thread_pointer 5@ += 80 0A8E: 6@ = 5@ + 12 //...
Current Ammo in the clip 0A96: 0@ = actor $PLAYER_ACTOR struct 0@ += 0x718 // Current Weapon Slot 0A8D: 1@ = read_memory 0@ size 1 virtual_protect 0 0A96: 0@ = actor $PLAYER_ACTOR struct 0@ += 0x5A0 // Start of weapon data (28 bytes) 1@ *= 28 005A: 0@ += 1@ // Get weapon structure 0@ += 8 // Pointer to "Ammo in clip" 0A8D: 3@ = read_memory 0@ size 1 virtual_protect 0 // Ammo in clip 3@ is the ammo in the clip. -._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._. Maximum Ammo in the clip : {$CLEO} const   FIRETYPE_MELEE = 0   FIRETYPE_INSTANT_HIT = 1   FIRETYPE_PROJECTILE = 2   FIRETYPE_AREA_EFFECT = 3   FIRETYPE_CAMERA = 4   FIRETYPE_USE = 5 end 0000: NOP while true  ...
With this function u can get the current Username of the Computer  :imoverit: //0AB1: @GetCurrentPcUserName 0 0@ :GetCurrentPcUserName IF 0AA2: 31@ = load_library "Advapi32.dll" THEN      0AC8: 1@ = allocate_memory_size 260     IF     0AA4: 30@ = get_proc_address "GetUserNameA" library 31@     THEN          0AC8: 0@ = allocate_memory_size 260            0AA5: call 30@ num_params 2 pop 0 0@ 1@         0AC9: free_allocated_memory 0@     ELSE         0AD3: 1@ = "ERROR"     END     0AA3: free_library 31@ END 0AB2: 1 1@
:getYAngleBetweenPoints {   Parameters:     Passed:       0@ - origin X       1@ - origin Y       2@ - origin Z       3@ - destination X       4@ - destination Y       5@ - destination Z     Result:       7@ - absolute Y angle   Example:     0AB1: call_scm_func @getYAngleBetweenPoints 6 from_XYZ 0.0 0.0 0.0 and_XYZ 1.0 0.0 0.0 store_to 1@ } 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 {   Parameters:     Passed:       0@ - origin X       1@ - origin Y       2@ - destination X       3@ - destination Y     Result:       4@ - absolute Z angle   Example:     0AB1: call_scm_func @getZAngleBetweenPoints 4 from_XY 0.0 0.0 and_XY 1.0...
Top