Fist Posted March 21, 2017 Share Posted March 21, 2017 (edited) Can anyone tell me how to detect players resolution and if it's 800x600 or lower then it kicks them? Edit: nvm you can do it by just using guiGetScreenSize i thought it was harder. ;d Edited March 21, 2017 by Fist Link to comment
Discord Moderators Pirulax Posted March 21, 2017 Discord Moderators Share Posted March 21, 2017 So, you solved the problem? Btw here is my code local x, y = guitGetScreenSize() local lowY = 800 local lowX = 600 if x == lowX and y == lowY then kickPlayer(thePlayer, "Your screen resolution is too low!") end : Link to comment
MIKI785 Posted March 21, 2017 Share Posted March 21, 2017 (edited) 8 minutes ago, Pirulax said: So, you solved the problem? Btw here is my code local x, y = guitGetScreenSize() local lowY = 800 local lowX = 600 if x == lowX and y == lowY then kickPlayer(thePlayer, "Your screen resolution is too low!") end : Just to make it clear, that wouldn't work, you're mixing server/client functions. You'd have to ask the server to kick you using triggerServerEvent, also if the player had a resolution of 640x480 (yes, small resolution like that is possible), it wouldn't work. Also, you mixed up your Xs and Ys, argh.. that code is just completely wrong Edited March 21, 2017 by MIKI785 1 Link to comment
Discord Moderators Pirulax Posted March 21, 2017 Discord Moderators Share Posted March 21, 2017 (edited) Okey, i am very tired, so here is the edited code ---- Client local y, x = guitGetScreenSize() local lowY = 800 local lowX = 600 if x == lowX and y == lowY then triggerServerEvent("kickPlayerForLowRes", localPlayer, getLocalPlayer()) end ---- Server addEvent("kickPlayerForLowRes", true) addEventHandler("kickPlayerForLowRes", getRootElement(), function(thePlayer) kickPlayer(thePlayer, "Your screen resolution is too low!") end) Edited March 21, 2017 by Pirulax Link to comment
#BrosS Posted March 21, 2017 Share Posted March 21, 2017 function KickLow () local x,y = guiGetScreenSize() if ( x <= 800 ) and ( y <= 600 ) then triggerServerEvent("kickPlayerForLowRes", localPlayer, getLocalPlayer()) end end addEventHandler ( "onClientPlayerJoin",root, KickLow ) ---- Server addEvent("kickPlayerForLowRes", true) addEventHandler("kickPlayerForLowRes", getRootElement(), function(thePlayer) kickPlayer(thePlayer, "Your screen resolution is too low!") end) @Pirulax you're wrong tho 1 Link to comment
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