View Issue Details

IDProjectCategoryView StatusLast Update
0006225Multi Theft Auto : San AndreasClientpublic2012-05-31 02:13
ReporterarranTuna Assigned ToCazomino05  
Status resolvedResolutionfixed 
Target Version1.3Fixed in Version1.3 
Summary0006225: [1.1 Beta] setControlState problems when controls are disabled

It appears that there is a new problem with setControlState:

If you disable GTA controls, using "forwards" does not work. It used to work though as thats how a player would be forced to follow somebody for example when arrested. Now when your controls are disabled the script can't control you either.

Steps To Reproduce

srun toggleAllControls(a, false, true, false)
srun setControlState(a, "forwards", true) -- does nothing
srun setControlState(a, "jump", true) -- makes you jump

TagsNo tags attached.


related to 0006206 resolvedTalidan Multi Theft Auto : San Andreas set(Ped)AnalogControlState 
related to 0006925 closed New issues [Request] setAnalogControlState 



2011-07-02 17:37

updater   ~~0013880

Lol, yeah. Just found out about it.


2011-07-16 22:03

manager   ~~0013992

Was introduced with


2011-08-01 02:18

administrator   ~~0014082

This probably applies to any controls affected by analog controls, i.e. "backwards", "left", "right", "vehicle_left", "vehicle_right", "accelerate", "brake_reverse", "steer_forward", "steer_backward" and any others I may have missed.

Is this bug affected by setControlState clientside? How about setAnalogControlState?

Please check all this stuff if you find time :)


2011-08-01 02:27

administrator   ~~0014085

Last edited: 2011-08-01 02:27

Actually, i just thought about why this happens. It should affect all analog controls when using setControlState serverside or clientside, with toggleControl or toggleAllControls. setAnalogControlState should be unaffected. Not that this isn't any less of a bug.


2011-08-01 02:52

administrator   ~~0014086

Last edited: 2011-08-01 02:52

For reference, if anyone else wants to fix it (otherwise i'll do it if i ever get time):
CClientPad::ProcessAllToggledControls should account for script overriden setControlState. setAnalogControlState is taken into account, because analog state overrides are called after ProcessAllToggledControls in CClientPed.cpp

Cleanest solution is probably to move CKeyBinds lines 2123 to 2187 (controller state alterations, excluding JoystickManager alterations) into deathmatch, and move them into a call after ProcessAllToggledControls, in a similar fashion to ProcessSetAnalogControlState in CClientPed.cpp.

Another solution is to redirect setControlState calls for analog controls to setAnalogControlState instead, or maybe even merge setControlState entirely.


2011-08-01 12:35

manager   ~~0014088

srun setPedAnalogControlState(a, "forwards", 1)

Didn't do anything, didn't even return anything

crun setAnalogControlState("forwards", 1)

Does work even when controls are disabled where setControlState did not.


2011-12-18 22:24

viewer   ~~0015404

Could not reproduce client-side or server-side. Possibly fixed already?


2011-12-18 23:25

manager   ~~0015406

It was all reverted before 1.1 release.


2012-05-29 22:52

administrator   ~~0016722

Looking back at this, by far the easiest way to tackle this would be to merge setControlState with setAnalogControlState internally but keeping compatibility.


2012-05-30 21:27

reporter   ~~0016729

that looks very easy to be honest, can you give me a poke when you are back I'll show you what I edited

Issue History

Date Modified Username Field Change