Snippets

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...
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@...
With this function you can create beeps with frequency. //0AB1: @MAKE_BEEP 2 FREQUENCY 0x25 TIME 1000 :MAKE_BEEP IF 0AA2: 31@ = load_library "kernel32.dll" THEN     IF     0AA4: 30@ = get_proc_address "Beep" library 31@     THEN         0AA5: _CALL_ 30@ num_params 2 pop 0 1@ 0@     END     0AA3: free_library 31@ END 0AB2: 0
This sends an packet to the server that says: I'm in that car as a pessanger. So if you wanna trollsomeones car onfoot: Just send this packet first and then driver sync^^ 0AB1: @PACKET_PASSENGER_SYNC 1 CAR_HANDLE 0@ :PACKET_PASSENGER_SYNC IF 0B2C: samp 30@ = get_vehicle_id_by_car_handle 0@ THEN     0AC8: 31@ = allocate_memory_size 24     0C0D: struct 31@ offset 0 size 2  = 30@     0C0D: struct 31@ offset 2 size 1  = 1     0C0D: struct 31@ offset 3 size 1  = 0     0C0D: struct 31@ offset 4 size 1  = 50     0C0D: struct 31@ offset 5 size 1  = 0     0C0D: struct 31@ offset 6 size 2  = 0     0C0D: struct 31@ offset 8 size 2  = 0                                                                  0C0D: struct 31@ offset 10 size 2 = 0     ...
In case if you enter an interior with a checkpoint inside it, you have to disable the marker before exit, otherwise the coords will freeze on the checkpoint from interior until you disable it. It works well only if there is maximum one checkpoint at once and if there's a small delay between the update of its location. Works well on RP server with player radar markers disabled, didn't test it on any server with enabled ones. 0A8D: 0@ = read_memory 0x00C7E018 size 4 virtual_protect 0  0@ += 0x30                                                0A8D: 0@ = read_memory 1@ size 4 virtual_protect 0        0A8D: 1@ = read_memory 0x00C7E018 size 4 virtual_protect 0  1@ += 0x34                                                0A8D: 1@ =...
Like before on the 0.3x version, here you can share updated offset's (mainly for m0d-s0beit). You can find the "stSAMP / SA:MP Info" at the following Place: SAMP_INFO_OFFSET - Tested (0.3z-RC1) (0x688) "samp.dll"+0x211A58
Top