[Scripting] GetScreenResolution & DisableControlAction

I recently started developing my own FiveM server and am working on making a new vehicle shop that is easily customized. So far, everything has been coming along very nicely. However, I am now at the stage where I need to start and working on the interface.

I’m no stranger to interface design or development, however, I have run into 2 obstacles;

1. GetScreenResolution ALWAYS returns 1280 and 720. No matter what display mode or resolution I play at, am I misusing this method or is it bugged…?

local screenWidth, screenHeight = GetScreenResolution()

2. DisableControlAction does not seem to work. I’m trying to prevent a player from exiting a vehicle. Thus using the INPUT_VEH_EXIT flag with an ID of 75. I tried a few other controls and I haven’t been able to disable any control.

DisableControlAction(0, 75, true)

Edit: Turns out I gotta do DisableControlAction every frame. Pretty sure I tried that before but the client froze, so I guess the most likely scenario is that I forgot to use Citizen.Wait().

Any help or pointers in the right direction would be greatly appreciated. :slight_smile:

yes, it is meant to only get aspect ratio, on 16:9 the game always uses a reference of 720p

Lock the vehicle:

SetVehicleDoorsLocked(veh, 4) -- CARLOCK_LOCKED_PLAYER_INSIDE

Thanks for the reply!

Makes sense, although I personally find the method name a bit misleading. Is there any current way to get the actual resolution, maybe I’ve overlooked the methods available? I don’t necessarily need it right now, but it’s always good to know if it’s there just in case. :slight_smile:

I thought locking the vehicle only prevent people from entering - not exiting. I’m glad I was wrong, haha.

Thanks again!