Skip to content

Add SA-MP fast weapon strafe glitch - #5103

Open
Dryxio wants to merge 1 commit into
multitheftauto:masterfrom
Dryxio:fast-weapon-strafe
Open

Add SA-MP fast weapon strafe glitch#5103
Dryxio wants to merge 1 commit into
multitheftauto:masterfrom
Dryxio:fast-weapon-strafe

Conversation

@Dryxio

@Dryxio Dryxio commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR add fastweaponstrafe to the existing glitch functions:

setGlitchEnabled("fastweaponstrafe", true)
isGlitchEnabled("fastweaponstrafe")

When enabled, changing direction while aiming react faster, similar to SA-MP.
It is disabled by default and the normal MTA movement stay unchanged when it is off.

Demo

sampstrafe_10mb.mp4

Motivation

This is not really a GTA or MTA bug, because MTA reproduce the original GTA SA behaviour here. But the direction changes while aiming feels very slow and not really enjoyable for gunplay. For players coming from SA-MP, this is also one of the complaint I heard the most about MTA gunplay.

Following the discussion in #2228, we tried for a long time to reproduce the SA-MP feeling only in Lua, by changing animation speed, blend time or replacing the gunmove animations. Some results were close, but never worked properly and not the same feeling at all.

The closest result we got was this Lua attempt,
but it was still not the same behaviour and was not clean enough to use.

The reason is that these Lua solutions only modify the animations, but cannot change the internal movement timestep used during the transition. This is why the behaviour cannot be reproduced cleanly only with a resource.

Closes #2228

Implementation

SA-MP use a separate timestep for CTaskSimpleUseGun::ControlGunMove, calculated from the frame rate sampled over short intervals. This PR reproduce this behaviour while the glitch is enabled and keep the current MTA code path when it is disabled.

The option is added to the existing client and server glitch lists. Its state is also synchronized in MapInfo with a versioned bit, so it is correctly applied when joining or reconnecting.

Test plan

Test resource:
faststrafe.zip

Server:

refresh
start fastweaponstrafe-toggle

Client:

/faststrafe

Aim with a weapon and alternate between left and right movement. The first command enable the faster direction changes and the second command restore the normal MTA behaviour.

Checklist

  • Your code should follow the coding guidelines.
  • Smaller pull requests are easier to review. If your pull request is beefy, your pull request should be reviewable commit-by-commit.

Comment thread Shared/sdk/net/SyncStructures.h Outdated
@Dryxio
Dryxio force-pushed the fast-weapon-strafe branch from dcd53b3 to 54fe598 Compare July 31, 2026 01:34
@Dryxio
Dryxio force-pushed the fast-weapon-strafe branch from 54fe598 to dc8aeca Compare July 31, 2026 01:36
@FileEX FileEX added the enhancement New feature or request label Aug 1, 2026
@guibzo

guibzo commented Aug 1, 2026

Copy link
Copy Markdown

cool. SA combat system really seems pretty stiff.

@pube1

pube1 commented Aug 2, 2026

Copy link
Copy Markdown

It looks great—this is something I've wanted for a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement new glitch for setGlitchEnabled that allows SA-MP-like strafing with an aimed weapon

4 participants