Snippets

This Snippet will instantly make your Camera Look on a specific 3D location. This Snippet actually has many uses like: Make our Camera Follow/Lock-on a certain Actor by feeding this snippet with its Position. Can be Used as an Aimbot, just feed this with a specified Camera XZ-Offsets for the Crosshair positions. Can be used for Debugging purposes like "Offset Visualizer" Tool? // 0AB1: @camatpos 5 _XYZ 0@ 1@ 2@ _withCamOffsetAngleX 3@ _andCamOffsetAngleZ 4@ :camatpos // ~~~~~~~~~~anti auto-vehicle cam movement if and TIMERA>=400 Actor.Driving($PLAYER_ACTOR) then 0A8C: write_memory 0xB70118 size 4 value 50.0 virtual_protect 0 // reset camera stabalizer timer, credit to Parazitas TIMERA = 0 end // ~~~~~~~~~~...
Computes the Vehicle's XYZ Rotation Velocity relative to its own X(Pitch), Y(Roll), and Z(Yaw) Axes. [/SPOILER] [/SPOILER] Computes the Vehicle's XYZ Rotation Velocity Relative to its own z(Roll) Axis. The Computation uses a Relative x(Pitch) Axis and Y(Roll) Axes pinned at 0.0 degrees. [/SPOILER] [/SPOILER] Computes the Vehicle's XYZ Rotation Velocity relative to the TrueNorth's Axis by NS, EW, and NW. [/SPOILER] [/SPOILER]
pRakClientInterface offset of 0.3.7 is 0x3c9 . Does someone know an offset of 0.3DL?
Based on this documentary, but this time I will demonstrate how we can register/Hook multiple new CMD and recover the parameters you've inputted in chat without using SAMPFUNCS Opcodes.
:get3DXYZInFrontOf{X,Y,Z,ZA,YA,Distance} {        Return:         PosX-InFrontOf         PosY-InFrontOf         PosZ-InFrontOf             Example: 0AB1: call_scm_func @get3DXYZInFrontOf 6 XYZ 1@ 2@ 3@ Z_Angle 4@ Y_Angle 5@  Distance 7.0 Return_XYZ_To 6@ 7@ 8@ } 3@ *= -1.0 02F6: 6@ = sine 3@ 006B: 6@ *= 5@ 005B: 0@ += 6@ 02F7: 6@ = cosine 3@ 006B: 6@ *= 5@ 005B: 1@ += 6@ 02F7: 6@ = cosine 4@ 0073: 5@ /= 6@ 02F6: 6@ = sine 4@ 006B: 5@ *= 6@ 005B: 2@ += 5@ 0AB2: ret 3 0@ 1@ 2@
With this snippet you can get digits from any text ! Explain.: {$CLEO} 0000: repeat wait 50 until 0AFA: is_samp_available 0AC8: 0@ = allocate_memory_size 260 0AD3: 0@ = format "aaa:12345678910" 0AC8: 1@ = allocate_memory_size 260 0AB1: call_scm_func @get_digits_to_print param_count 2 text 0@ memory_to_store_digits_as_text 1@ chatmsg 1@ -1 0A93: end_custom_thread :get_digits_to_print { 0@ = text 1@ = pointer to memory where digits will be stored as text } 0C17: 31@ = strlen 0@ for 30@ = 0 to 31@ 0085: 29@ = 0@ // copy pointer 005A: 29@ += 30@ // add offset (as the loop progresses it becomes pointers to first-last character) 0A8D: 28@ = read_memory 29@ size 1 virtual_protect 1 // 28@ is the...
With this snippet we can create samp dialog. Good luck... Explain with 0.3.7 .: {$CLEO .cs} 0000: wait 8500 WHILE TRUE WAIT 0 IF 0AB0: 49 {Key 1} THEN 0AC8: 0@ = allocate_memory_size 260 0AC8: 1@ = allocate_memory_size 260 0AC8: 2@ = allocate_memory_size 260 0AC8: 3@ = allocate_memory_size 260 0AD3: 0@ = format "This is Dialog caption" 0AD3: 1@ = format "DialogText %cDialogText" 0xA // 0xA - NEW LINE 0AD3: 2@ = format "Ok" 0AD3: 3@ = format "Close" 0AB1: @ShowDialog 6 id 1000 caption 0@ text 1@ button_1 2@ button_2 3@ style 2 wait 300 END END :ShowDialog IF 0AA2: 10@ = "samp.dll" THEN 0A8E: 11@ = 10@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET 0A8D: 12@ = readMem 11@ sz 4 vp 1...
IF 0ADC: test_cheat "RO" THEN 0A92: create_custom_thread "MyScriptName.cs" 0AD1: show_formatted_text_highpriority "Reloading..." time 9999 0A93: end_custom_thread END Example
: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...
Example {$CLEO .cs} 0000: NOP wait 10000 13@ = Render.CreateFont("Verdana", 8, 12) WHILE TRUE WAIT 0 if 0AB0: KEY_X 88 then 0A8D: 29@ = read_memory 0xB7449C size 4 virtual_protect 0 000A: 29@ += 0x4 0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0 for 30@ = 0 to 89344 step 0x100 0A8D: 31@ = read_memory 29@ size 1 virtual_protect 0 000A: 29@ += 0x1 if and 0029: 31@ >= 0x00 001B: 0x80 > 31@ then 005A: 31@ += 30@ if and 03CA: object 31@ exists 02CC: object 31@ bounding_sphere_visible then 01BB: store_object 31@ position_to 1@ 2@ 3@ 0B55...
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...
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...
: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...
Top