Skip to content

Commit 306ac39

Browse files
committed
refactor: update getPedControlState calls to include localPlayer
1 parent e92a509 commit 306ac39

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

[editor]/freecam/freecam.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function getKeyState(key)
5757
return mta_getKeyState(controlToKey[key])
5858
else
5959
-- We can use getControlState
60-
return getPedControlState(key)
60+
return getPedControlState(localPlayer, key)
6161
end
6262
end
6363

@@ -96,7 +96,7 @@ local function freecamFrame ()
9696
speed = speed + acceleration
9797
speedKeyPressed = true
9898
end
99-
if ( getKeyState ( options.key_backward ) or getPedControlState ( options.key_backward_veh ) ) and not getKeyState("arrow_d") then
99+
if ( getKeyState ( options.key_backward ) or getPedControlState ( localPlayer, options.key_backward_veh ) ) and not getKeyState("arrow_d") then
100100
speed = speed - acceleration
101101
speedKeyPressed = true
102102
end

[gamemodes]/[race]/[addons]/race_ghost/record_client.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ end
173173
function GhostRecord:checkStateChanges()
174174
-- Keys
175175
for _, v in ipairs( keyNames ) do
176-
local state = getPedControlState( v )
176+
local state = getPedControlState( localPlayer, v )
177177
if not state and analogNames[v] then
178178
-- Not a really good implementation, but didn't think if anything else
179179
state = getAnalogControlState( v ) >= 0.5

[gamemodes]/[race]/[addons]/race_nos/c_main.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ addEventHandler( "onClientRender", root,
9494
dxDrawImage( g_tGaugePosition[ 1 ] + 45, g_tGaugePosition[ 2 ] + 41, 10, 40, "gauge/nos_arrow.png", nosangle, 0, -11, tocolor( 255, 0, 0 ) );
9595

9696
local nitro = getVehicleUpgradeOnSlot( veh, 8 );
97-
if ( getPedControlState( "vehicle_fire" ) and type( nitro ) == "number" and nitro ~= 0 ) then
97+
if ( getPedControlState( localPlayer, "vehicle_fire" ) and type( nitro ) == "number" and nitro ~= 0 ) then
9898
if nos > 0 then
9999
nos = nos - .2;
100100
if getTickCount() - clicktick > 20000 then

[gamemodes]/[stealth]/stealth/noisebar.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -217,18 +217,18 @@ addCommandHandler ( "crippleme", startalimp )
217217

218218
function movementcheck ( source, key, keystate )
219219
if ( isPedDucked ( getLocalPlayer () ) ) == false then
220-
if ( getPedControlState ( "sprint" ) ) then
220+
if ( getPedControlState ( localPlayer, "sprint" ) ) then
221221
soundlevel = soundlevel +1
222222
end
223-
if ( getPedControlState ( "walk" ) ) == false then
223+
if ( getPedControlState ( localPlayer, "walk" ) ) == false then
224224
soundlevel = soundlevel +1
225225
end
226226
end
227227
end
228228

229229
function walksoundstop ( source, key, keystate )
230230
if isplayermoving == 1 then
231-
if ( getPedControlState ( "forwards" ) ) == false and ( getPedControlState ( "backwards" ) ) == false and ( getPedControlState ( "left" ) ) == false and ( getPedControlState ( "right" ) ) == false then
231+
if ( getPedControlState ( localPlayer, "forwards" ) ) == false and ( getPedControlState ( localPlayer, "backwards" ) ) == false and ( getPedControlState ( localPlayer, "left" ) ) == false and ( getPedControlState ( localPlayer, "right" ) ) == false then
232232
killTimer ( movementsound )
233233
isplayermoving = 0
234234
end

0 commit comments

Comments
 (0)