Skip to content

Commit a092c3a

Browse files
ricksterhd123xLive
andauthored
speedometer: Check vehicle occupied by localPlayer (#334)
* Check vehicle occupied by localPlayer * Update [gameplay]/speedometer/client.lua Co-authored-by: Nawaf Alqarni <[email protected]> Co-authored-by: Nawaf Alqarni <[email protected]>
1 parent 8957c84 commit a092c3a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

[gameplay]/speedometer/client.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ addEventHandler("onClientElementDestroy", root, destroyHandler)
6161

6262
-- If player vehicle changes in abnormal way (e.g drives into a vehicle pick-up)
6363
local function onVehicleTypeChange(oldModel, newModel)
64-
if (getElementType(source) ~= "vehicle") then return end
64+
if (getPedOccupiedVehicle(localPlayer) ~= source) then return end
6565

6666
local newType = getVehicleType(newModel)
6767

0 commit comments

Comments
 (0)