Snippets

:sampSendClickTextdraw { 0.3.7 - R1 0BCA: @sampSendClickTextdraw 1 TextDrawID 0@ } if 0AA2: 2@ = "samp.dll" then 0085: 3@ = 2@ 3@ += 0x21A0CC 0A8D: 3@ = readMem 3@ sz 4 vp 1 0A8E: 4@ = 3@ + 8 0A8C: writeMem 4@ sz 4 value 0@ vp 0 0A8E: 5@ = 2@ + 0x6CEA0 0AA6: call 5@ struct 3@ num_params 0 pop 0 end 0AB2: 0 :sampSendClickTextdraw { 0.3.7 - R2 0BCA: @sampSendClickTextdraw 1 TextDrawID 0@ } if 0AA2: 2@ = "samp.dll" then 0085: 3@ = 2@ 3@ += 0x21A0D4 0A8D: 3@ = readMem 3@ sz 4 vp 1 0A8E: 4@ = 3@ + 8 0A8C: writeMem 4@ sz 4 value 0@ vp 0 0A8E: 5@ = 2@ + 0x6CF40 0AA6: call 5@ struct 3@ num_params 0 pop 0 end 0AB2: 0 :sampSendClickTextdraw { 0.3.7 - R3...
const SAMP_CHAT_INFO_OFFSET = 0x212A6C SAMP_CHAT_INFO_OFFSET_R2 = 0x212AA4 FUNC_ADDTOCHATWND = 0x7A4F0 FUNC_ADDTOCHATWND_R2 = 0x61AB0 FUNC_SAY = 0x4CA0 FUNC_SAY_R2 = 0x4C30 end 0AF9(SFUNCS) Sends a message in chat //0AB1: @SAY 1 $text :SAY IF 0AA2: 1@ = "samp.dll" THEN     1@ += FUNC_SAY     0AA5: call 1@ num_param 1 pop 0 0@ END 0AB2: 0 0AF8(SFUNCS) Add a message to chat(not synched) //0AB1: @addMsgToChatWnd 2 $color $text :addMsgToChatWnd IF 0AA2: 2@ = "samp.dll" THEN     0085: 3@ = 2@     3@ += SAMP_CHAT_INFO_OFFSET     0A8D: 3@ = readMem 3@ sz 4 vp 1     0085: 4@ = 2@     4@ += FUNC_ADDTOCHATWND        0AA6: call 4@ struct 3@ num_params 5 pop 0 params 0 0@ 0 1@ 8 END 0AB2: 0 Simple example;
:RotationSpeedAngleZ { Status 1 = true Status 0 = false 0AB1: @RotationSpeedAngleZ 1 Status 1 } 0A96: 1@ = ped $PLAYER_ACTOR struct 0A8E: 2@ = 1@ + 0x560 // CPed +0x560 = [float] Rotation speed (Z angle) IF 0@ == 1 THEN 0A8C: writeMem 2@ sz 4 val 30.0 vp 1 ELSE 0A8C: writeMem 2@ sz 4 val 7.5 vp 1 END 0AB2: 0 Example
:SendLagRate { Status 1 = true Status 0 = false 0AB1: @SendLagRate 2 SampVersionID 0@ Status 1 } IF 0AA2: 10@ = "samp.dll" THEN IF 0@ == 1 // 0.3.7 R1 THEN IF 1@ == 1 THEN 0A8E: 11@ = 10@ + 0xEC0A8 0A8D: 12@ = readMem 11@ sz 4 vp 0 0A8C: writeMem 11@ sz 4 val 500 vp 0 0A8E: 11@ = 10@ + 0xEC0AC 0A8D: 13@ = readMem 11@ sz 4 vp 0 0A8C: writeMem 11@ sz 4 val 500 vp 0 0A8E: 11@ = 10@ + 0xEC0B0 0A8D: 14@ = readMem 11@ sz 4 vp 0 0A8C: writeMem 11@ sz 4 val 500 vp 0 ELSE 0A8E: 11@ = 10@ + 0xEC0A8 0A8C: writeMem 11@ sz 4 val 12@ vp 0...
This is FPSUnlocker (From 0.3.7 R1 - 0.3.7 R3 + 0.3.DL - R1). You can use it on new cleo extension Cleo Redux: https://re.cleo.li/. Resource: /* FPSUnlocker for 0.3.7 - R1, 0.3.7 - R2, 0.3.DL - R1, 0.3.7 - R3 SAMP versions. FPSUnlocker function is reading the SAMP version from memory address + Library(samp.dll) which creates an address with which we can turn off the "NO_GAME_PAUSING" function which, as you assume, excludes the fps limit... Author: Fr0z3n - https://ugbase.eu/members/frozen.57428/ --------------------------------------------------------------- get_samp_version_id - https://ugbase.eu/threads/snippet-get-samp-version-js.22844/ */ // Pre-conf. /// <reference path=".config/sa.d.ts" /> ///...
This is snippet for getting samp versions(From 0.3.7 R1 - 0.3.7 R4 - 2). You can use it on new cleo extension Cleo Redux: https://re.cleo.li/. The code contains 2 functions: - get_samp_version_id - 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 since 00:00 January 1, 1970 (a C run-time time_t value), that indicates when the file was created. " In most versions that time stamp is located at offset 0x128 from samp.dll. In...
:IsSAMPRunnedAsAdministrator if 0AA2: 31@ = load_dynamic_library "Shell32.dll" then if 0AA4: 30@ = get_dynamic_library_procedure "IsUserAnAdmin" library 31@ then 0AA7: call_function_return 30@ num_params 0 pop 0 _StoreBooleanTo 29@ end 0AA3: free_dynamic_library 31@ end if 29@ == true then 0485: return_true else 059A: return_false end 0AB2: cleo_return 0 Demonstration: {$CLEO} 0000: while true wait 0 if 0AB1: @IsSAMPRunnedAsAdministrator 0 then 0ACD: show_text_highpriority "GTA SAMP was Runned as Administrator" time 100 else 0ACD: show_text_highpriority "GTA SAMP has no Administrative Privileges" time 100 end end Notes: This Snippet only Detects...
OPCODES: 0B48: samp 1@ = get_current_dialog_list_item 0B49: samp set_current_dialog_list_item 1@ Without SAMPFUNCS Snippets.: 0.3.7 - R1 :Get_current_dialog_list_item { 0.3.7 - R1 0AB1: @Get_current_dialog_list_item 0 0@ } 0AA2: 1@ = "samp.dll" 1@ += 0x21A0B8 0A8D: 1@ = readMem 1@ sz 4 vp 0 1@ += 0x1C 0A8D: 1@ = readMem 1@ sz 4 vp 0 1@ += 0x443 0A8D: 1@ = readMem 1@ sz 1 vp 0 0AB2: 1 1@ :Set_current_dialog_list_item { 0.3.7 - R1 0AB1: @Set_current_dialog_list_item 1 ItemNumber 1 } 0AA2: 1@ = "samp.dll" 1@ += 0x21A0B8 0A8D: 1@ = readMem 1@ sz 4 vp 0 1@ += 0x1C 0A8D: 1@ = readMem 1@ sz 4 vp 0 1@ += 0x443 0A8C: write_memory 1@ size 1 value 0@ virtual_protect 0 0AB2: 0 0.3.7 - R2 :Get_current_dialog_list_item {...
:ForcePressGameKey // 0AB1: @ForcePressGameKey 2 _GTASA_Key 0@ _isalternatekey 1@ 0@ *= 2 if 1@ > 0 then 0@++ // next byte = alternate key end 0@ += 0xB734D0 // High Priority Controls 0A8C: write_memory 0@ size 1 value 255 virtual_protect 0 ret 0 :ForcePressGameKeyOffset // 0AB1: @ForcePressGameKeyOffset 1 _KeyOffset 0@ 0@ += 0xB734D0 // High Priority Controls 0A8C: write_memory 0@ size 1 value 255 virtual_protect 0 ret 0 KeyOffset , GTASA_Key , isalternatekey = OnFoot Control / InCar Control 0 , 0 , false = Move Right / Steer Right 1 , 0 , true = Move Left / Steer Left 2 , 1 , false = Move Backward / Steer Down 3 , 1 , true = Move Forward / Steer Up...
If you want to get the IP Address,Subnet Mask,Default Gateway,DHCP Server,Primary WINS Server,Secondary WINS Server then use this snippet: const // put this const at the header of the code ADAPTERCAPACITY = 4096 // ADAPTERCAPACITY >= 640 * ADAPTERSCOUNT // make sure to count the number of adapters you have at your computer. IPOFFSETIPADDRESS = 0x1B0 // Current IP Address IPOFFSETSUBNETMASK = 0x1C0 // Subnet Mask IPOFFSETGATEWAY = 0x1D8 // Default Gateway IPOFFSETDHCPSERVER = 0x1E8 // DHCP Server IPOFFSETPWINSS = 0x200 // Primary WINS Server IPOFFSETSWINSS = 0x210 // Secondary WINS Server end const // used by GetMyLocalIP ADAPTERLIBRARY = 31@...
Since, 0AB5 do not work in Multi-Player. There is a simple method of taking nearest car with specific radius! 00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@ // This will store the XYZ Position in Variable 1@ 2@ 3@ (X = 1@, Y = 2@, Z = 3@) 0AE2: 4@ = random_vehicle_near_point 1@ 2@ 3@ in_radius 10.0 find_next 0 pass_wrecked 0 // random car in near point and Kinda useless but snippet is snippet! Constant radius i recommend is 9.0
Hi. I download Chat++ but it's not working for me. It's not even opening box where is Copy and other shiet. So can someone help how to use it or something. Adding file which is not working for me...
If you don't have SAMPFUNCS and needs to convert between Window Screen Coordinate System and Game Screen Coordinate System, try using these converter snippets:
:hellno: But that line will be strange when its moving  :okey: //0AB1: @DRAW_LINE 9 POS 10.0 10.0 _TO_ 200.0 310.0 RGBA 255 0 0 255 THICKNESS 1.0 :DRAW_LINE 0087: 11@ = 2@ // (float) 0087: 12@ = 3@ // (float) 0509: 10@ = distance_between_XY 0@ 1@ and_XY 2@ 3@ 10@ -= 37.0 {REMOVE STRANGE OFFSET AT END} 0063: 2@ -= 0@ // (float) 0063: 3@ -= 1@ // (float) 0604: get_Z_angle_for_point 2@ 3@  store_to 9@ 9@ += 84.0 005B: 0@ += 11@ 0@ /= 2.0    {MITTE} // get center pos 005B: 1@ += 12@ 1@ /= 2.0 03F0: enable_text_draw 1 074B: draw_texture 666 position 0@ 1@ scale 10@ 8@ angle 9@ color 4@ 5@ 6@ 7@ 0AB2: 0
With this snippet we can get nick name. Good luck... Explain with 0.3.7 .: {$CLEO .cs} 0000: repeat wait 0 until 0afa: WHILE TRUE wait 0 call @Get_LocalPlayer_Name 0 0@ chatmsg "%s" -1 0@ END :Get_LocalPlayer_Name /// 0AB1: call_scm_func @Get_My_NickName 0 0@ 0AA2: 0@ = loadLib "samp.dll" //samp base offset 0@ += 0x21A0F8 0A8D: 0@ = readmem 0@ sz 4 vp 0 //stInfo 0@ += 0x3CD 0A8D: 0@ = readmem 0@ sz 4 vp 0 //stPools 0@ += 0x18 0A8D: 0@ = readmem 0@ sz 4 vp 0 //stPlayerPools 0@ += 0xA //szLocalPlayerName 0AB2: ret 1 0@ Snippets.: 0.3.7 :Get_LocalPlayer_Name /// 0AB1: call_scm_func @Get_LocalPlayer_Name 0 0@ 0AA2: 0@ = loadLib "samp.dll" //samp base offset 0@ += 0x21A0F8 0A8D: 0@ = readmem 0@ sz 4 vp 0...
//0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 0@ Y 1@ Z 2@ store_screen_X_to 3@ Y_to 4@ :getScreenXYFrom3DCoords 0AC7: 14@ = var 0@ offset 0AC7: 15@ = var 3@ offset 0AC7: 16@ = var 6@ offset 0AC7: 17@ = var 9@ offset 0AA5: call 0x70CE30 num_params 6 pop 6 {18@ 18@} 0 0 17@ 16@ 15@ 14@ 0007: 12@ = 640.0 0007: 13@ = 448.0 0A8D: 14@ = read_memory 0xC17044 size 4 virtual_protect 0 0A8D: 15@ = read_memory 0xC17048 size 4 virtual_protect 0 0093: 14@ = integer 14@ to_float 0093: 15@ = integer 15@ to_float 0073: 12@ /= 14@ 0073: 13@ /= 15@ 006B: 3@ *= 12@ 006B: 4@ *= 13@ 0AB2: ret 2 3@ 4@
With this snippet, you can generate a fabricated name from a random online player in the server: Player Name Spoofing is a method where in you Pretend to be other Player's Name. This type of trick is Mostly used to deceive other players that knows the target. There are many ways to Spoof nicknames. Interchanging letter "l or small L" and "I or big i" on player names. Can you tell the difference between letters "l and I" in SAMP? The Deception percentage is 100%. The Respective list have a Deception percentage of 100(n-(1/n))% where "n" is the length on the target nickname. So having a namelength of 10 will have a deception percentage of 90% Dot(.) Name Addition - adding extra dot at the beggining or at the end of the name. Numerical...
This Snippet will get any actor that is near the specified part of the screen. This snippet is actually advanced and hard to understand by some users. But I will try to Pinpoint its use: A 2D Rectangle somewhere within the screen will bound the area of where desired actors will be fetched. the Drawing of Rectangle is from TopLeft to BottomRight Inside the 2D Rectangle, the user has an option to pin a "Base Coordinate". This Base Coordinate will be the "Center of Radius" for fetching nearby actors. The Base Coordinate(_nearscreencoordXY) shall be within the 2D Rectangle. It has a parameter to IGNORE a specific Actor that will not be processed during the actor fetching. The Actor fetching is all screen based(bounded within the...
Gets the Point from an origin to target point with a specific distance offset. { gets the point towards another point with a specific offset Usage: 0AB1: @getpointwithpolaroffset 7 _fromXYZ 0@ 1@ 2@ _offsetdistance 3@ _towardsXYZ 4@ 5@ 6@ _storeXYZ 29@ 30@ 31@ Examples: 0AB1: @getpointwithpolaroffset 7 _fromXYZ 0@ 1@ 2@ _offsetdistance 1.0 _towardsXYZ 4@ 5@ 6@ _storeXYZ 29@ 30@ 31@ // pointA towards to pointB 0AB1: @getpointwithpolaroffset 7 _fromXYZ 0@ 1@ 2@ _offsetdistance -1.0 _towardsXYZ 4@ 5@ 6@ _storeXYZ 29@ 30@ 31@ // pointA away to pointB } :getpointwithpolaroffset // ~~~~~~~~~~~get z-angle towards the target with respect to world z angle 0087: 30@ = 5@ // Y2 0063: 30@ -= 1@ // Y1 0087: 31@ = 4@...
Code return: Screen resolution with float and int format . Everything depends which one you need use in your code... :getScreenResolution //0AB1: @getScreenResolution 0 ScreenX {Float} 0@ ScreenY {Float} 1@ ScreenX {int} 2@ ScreenY {int} 3@ 0A8D: 0@ = read_memory 0xC17044 size 4 virtual_protect 0 // (int) full screen X 0085: 4@ = 0@ // copy (int) full screen X 0093: 0@ = integer 0@ to_float 7@ = 640.0 // screen X 0A8D: 1@ = read_memory 0xC17048 size 4 virtual_protect 0 // (int) full screen Y 0085: 5@ = 1@ // copy (int) full screen Y 0093: 1@ = integer 1@ to_float 8@ = 448.0 // screen Y 0087: 2@ = 0@ // copy (float) full screen X 0087: 3@ = 1@ // copy (float) full screen Y 10@ = 1280.0 // screen X * 2 11@ = 896.0 // screen Y * 2 if 0@...
It affects in only 1 frame. It means that you have to call this in every frame and you can use this to any objects. :ATTACH // 0AB1: @ATTACH 6 AS_actor $PLAYER_ACTOR attach_to_object 0@ offset 0.0 0.0 0.0 on_bone 6 0A9F: 6@ = current_thread_pointer 000A: 6@ += 0x44 0A96: 7@ = actor 0@ struct 0085: 0@ = 7@ // (int) 000A: 0@ += 0x18 0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0 0AA7: call_function 0x734A40 num_params 1 pop 1 0@ 0@ // _clumpGetFirstSkinAtomicHAnimHierarchy 0012: 5@ *= 0x4 000A: 5@ += 0x488 005A: 5@ += 7@ // (int) 0A8D: 5@ = read_memory 5@ size 4 virtual_protect 0 000A: 5@ += 0x14 0A8D: 5@ = read_memory 5@ size 4 virtual_protect 0 0A8D: 7@ = read_memory 0x7C51E0 size 4 virtual_protect 1 if 0039: 7@ == 0x424548B...
OK, because I always hack on servers. I use this snippet to change my name into a random/obfuscated string before I log out so that I will not get caught by admins.It is an awesome snippet for me. Idea: It can be integrated on cleo scripts that changes the player name everytime he joins a server... Interesting. { Usage: 0AC8: 0@ = allocate_memory_size 21 0AB1: call_scm_func @randomnamegenerator 2 _inoutname 0@ _charcount 20 0AD1: show_formatted_text_highpriority "%s" time 2000 0@ 0AC9: free_allocated_memory 0@ NOTICE: - THE ALLOCATED MEMORY MUST BE GREATER THAN THE CHARACTER COUNT! As you can see on the example usage the allocated is 21 and the charcount is 20, you can set more than 21 allocated...
Top