5150 Posted March 21, 2016 Share Posted March 21, 2016 i have this script for hiding huds but when i respawn, the hud appears again. whats wrong? local hudTable = { "radar", "ammo", "weapon", "area_name", "wanted", "money", "health", "clock", "vehicle_name" } addEventHandler("onClientResourceStart", resourceRoot, function() for id, hudComponents in ipairs(hudTable) do showPlayerHudComponent(hudComponents, false) end end ) addEventHandler("onClientResourceStop", resourceRoot, function() for id, hudComponents in ipairs(hudTable) do showPlayerHudComponent(hudComponents, true) end end ) Link to comment
undefined Posted March 21, 2016 Share Posted March 21, 2016 local hudTable = { "radar", "ammo", "weapon", "area_name", "wanted", "money", "health", "clock", "vehicle_name" } function hideHUD(enable) for _, hud in ipairs(hudTable) do showPlayerHudComponent(hud, enable) end end addEventHandler("onClientResourceStart", resourceRoot, function() hideHUD(false) end) addEventHandler("onClientPlayerSpawn", getLocalPlayer(), function() hideHUD(false) end) addEventHandler("onClientResourceStop", resourceRoot, function() hideHUD(true) end) Link to comment
5150 Posted March 21, 2016 Author Share Posted March 21, 2016 it still shows the hud after you respawn Link to comment
Captain Cody Posted March 21, 2016 Share Posted March 21, 2016 local hudTable = { "radar", "ammo", "weapon", "area_name", "wanted", "money", "health", "clock", "vehicle_name" } function hideHUD(enable) for _, hud in ipairs(hudTable) do showPlayerHudComponent(hud, enable) end end addEventHandler("onClientResourceStart", resourceRoot, function() hideHUD(false) end) addEventHandler("onClientPlayerSpawn", getLocalPlayer(), function() setTimer ( hideHUD, 2000, 1, false ) end) addEventHandler("onClientResourceStop", resourceRoot, function() hideHUD(true) end) Adds that small delay needed for the client to utilize the hud and stuff. Link to comment
5150 Posted March 22, 2016 Author Share Posted March 22, 2016 works, thanks i shortened the time to 500 so its not there for so long. maybe you can take a look at the topic i just posted? got a complicated issue Link to comment
5150 Posted March 22, 2016 Author Share Posted March 22, 2016 sorry to crap in your cornflakes but the hud will stay hidden, then about 5 minutes later the radar will come back. but only the radar Link to comment
Captain Cody Posted March 22, 2016 Share Posted March 22, 2016 https://wiki.multitheftauto.com/wiki/OnClientHUDRender function hidehud() hideHUD(false) end addEventHandler("OnClientHUDRender",root,hidehud) 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