Open jayceon123 opened 3 years ago
getPedControlState("enter_exit")
is not valid. Please refer to https://wiki.multitheftauto.com/wiki/GetPedControlState and fix your example.
Fixed.
Did you just remove the line or did you also test it too? I'd assume your issue was because of getPedControlState failing due to invalid arguments (and not executing the line afterwards).
I tested one by one first, and just put together in the example. E.: Tested multiple controls too.
The same behavior happens with me, always returning false, even for both cases below:
addEventHandler("onClientVehicleStartEnter", root, function(player,seat,door)
if (player == localPlayer and seat == 0)then
print(getPedControlState(localPlayer, "enter_exit"))
end
end)
and
addEventHandler("onClientRender", root, function()
print(getPedControlState(localPlayer, "enter_exit"))
end)
Confirmed it returns false when pressing or holding the bound key near or not a vehicle.
However, not sure what the use-case for this is right now. Can you describe the use-case where you would need the control state of enter_exit? You do know there are ped tasks you can use to determine a lot of actions accurately?
Meanwhile we should probably look into the reason why this is returning false, and under what conditions it would return true.
I just wanted to do something when the player presses the key that binded to the control, so I tried to use it with this way without the bindKey function, but faced with this not expected behaviour.
Just found out, the 'change_camera' control returns false too. Maybe there are some more affected controls.
We should check back when these issues started happening. I have a feeling this is a regression from some recent changes.
It has been like this forever, reason is here
enter_exit is "ButtonTriangle" and change_cam "Select" on the game pad, so should be fixable with the following
case 9:
return State.ButtonTriangle == 255;
break; // enter_exit
case 10:
return State.Select == 255;
break; // change_cam
EDIT: Why is there a break
after a return
in this code lol
Is there any potential issue with implementing this change? I don't see why "enter_exit" should remain an exception here
Describe the bug The getPedControlState function returns false everytime for the "enter_exit" control. Only tested with the localPlayer.
To reproduce
Expected behaviour Return with the real value.
Screenshots /
Version MTA:SA Client 20935 MTA:SA Server 20935
Additional context /