LOOah 3 Posted Monday at 17:15 Share Posted Monday at 17:15 (edited) Hi, I have a question, how can I block the option to set the debugging option on #grapics, I know that it can be blocked somehow because on the TOP-GTA server, when we set ourselves in options -> advanced and debug settings on #graphics, it pops up black screen saying to change to default, but I don't know what function checks whether the player has it set or not. Regards Edited Monday at 17:16 by LOOah Link to post
XaskeL 69 Posted Monday at 17:35 Share Posted Monday at 17:35 (edited) local scx, scy = guiGetScreenSize( ); addEventHandler( "onClientRender", root, function ( ) if ( #engineGetVisibleTextureNames( ) < 1 ) then dxDrawRectangle( 0, 0, scx, scy, tocolor( 0, 0, 0, 255 ), false ); end end ); in theory this should work Edited Monday at 17:40 by XaskeL 1 Link to post
IIYAMA 1,243 Posted Monday at 17:40 Share Posted Monday at 17:40 19 minutes ago, LOOah said: Hi, I have a question, how can I block the option to set the debugging option on #grapics, I know that it can be blocked somehow because on the TOP-GTA server, when we set ourselves in options -> advanced and debug settings on #graphics, it pops up black screen saying to change to default, but I don't know what function checks whether the player has it set or not. Regards Not sure which option you are referring to (I do not have access to my pc at the moment so I can't check). But the following function contains some of the settings, maybe it is in there: https://wiki.multitheftauto.com/wiki/DxGetStatus 1 Link to post
XaskeL 69 Posted Monday at 18:01 Share Posted Monday at 18:01 -- Author: XaskeL -- Created 04/05/2021 -- https://forum.mtasa.com/topic/130216-help-debug-settings-graphics local CGraphicsDebug = { addEventHandler = addEventHandler; dxDrawRectangle = dxDrawRectangle; dxDrawText = dxDrawText; setTimer = setTimer; engineGetVisibleTextureNames = engineGetVisibleTextureNames; localPlayer = localPlayer; guiGetScreenSize = guiGetScreenSize; resourceRoot = resourceRoot; root = root; g_bRenderInfo = false; g_iInterval = 2000; g_bOverlayDraw = true; BLACK = tocolor( 0, 0, 0, 255 ); WHITE = -1; }; CGraphicsDebug.__index = CGraphicsDebug; setmetatable( CGraphicsDebug, { __index = _G; } ); setfenv( 1, CGraphicsDebug ); local g_fScreenX, g_fScreenY = guiGetScreenSize( ); CGraphicsDebug.OnRender = function ( ) dxDrawRectangle( 0, 0, g_fScreenX, g_fScreenY, BLACK, g_bOverlayDraw ); dxDrawText( "Set debug settings to default", 0, 0, g_fScreenX, g_fScreenY, WHITE, 1.0, "bankgothic", "center", "center", false, false, g_bOverlayDraw ); end; CGraphicsDebug.OnCheck = function ( ) if ( #engineGetVisibleTextureNames( ) < 1 ) then if ( not g_bRenderInfo ) then addEventHandler( "onClientRender", root, OnRender ); g_bRenderInfo = true; return; end else if ( g_bRenderInfo ) then removeEventHandler( "onClientRender", root, OnRender ); g_bRenderInfo = false; return; end end end; CGraphicsDebug.OnStart = function ( ) setTimer( OnCheck, g_iInterval, 0 ); end; addEventHandler( "onClientResourceStart", resourceRoot, OnStart ); Code that is 100% functional and can be used in a client-side project. 1 Link to post
LOOah 3 Posted Monday at 21:50 Author Share Posted Monday at 21:50 Thanks guys that help a lot Link to post
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now