..:D&G:.. Posted February 14, 2014 Share Posted February 14, 2014 Hey, I recently made a hud, and with the help of some scripters from the forum, I made it so people can toggle it. I don't know how to make it hide when people join, so they have to type "/showhud" for the hud to appear. local renderHud = function () local munitie = getPedTotalAmmo ( localPlayer) local clip = getPedAmmoInClip ( localPlayer) local IDarma = getPedWeapon(localPlayer) local arma = getWeaponNameFromID(IDarma) local viata = getElementHealth (localPlayer) local armura = getPedArmor (localPlayer) local bani = getPlayerMoney()-- "thePlayer" this shouldn't be there. -- put your dx stuff here-- -------------------------------- end local handler = true addEventHandler("onClientRender",root,renderHud) addCommandHandler("showhud", function () if handler then removeEventHandler("onClientRender",root,renderHud) handler = false else addEventHandler("onClientRender",root,renderHud) handler = true end end) I tried to change the local handler = true into local handler = false but no luck... any ideas? Link to comment
Karuzo Posted February 14, 2014 Share Posted February 14, 2014 I think you should remove the EventHandler in Line 20. Link to comment
Moderators Citizen Posted February 14, 2014 Moderators Share Posted February 14, 2014 I think you should remove the EventHandler in Line 20. Yeah and set handler to true at line 19 too, otherwise the player would have to enter that command twice to show it. Link to comment
..:D&G:.. Posted February 16, 2014 Author Share Posted February 16, 2014 Done it, thanks 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