SkatCh Posted June 18, 2014 Posted June 18, 2014 hi guys please i need some help i create a new Hud for my server and it's working fine , but the problem when i try to (reconnect or quit and join again) i can see the Hud with the login panel , i want to see it just when the player join the game i used this event , "onClientHUDRender" , is there anyway to fix it . i'm sorry about my english . Failure is simply an opportunity to begin again more intelligently - Henry Ford
Snow-Man Posted June 18, 2014 Posted June 18, 2014 (edited) hi guys please i need some help i create a new Hud for my server and it's working fine , but the problem when i try to (reconnect or quit and join again) i can see the Hud with the login panel , i want to see it just when the player join the game i used this event , "onClientHUDRender" , is there anyway to fix it .i'm sorry about my english . Explain more about your problem you want when player login hud will be visible, if Yes use Edited June 19, 2014 by Guest USC Informations Head Staff & Owner Of USC. Youtube Channel : My Channel
SkatCh Posted June 18, 2014 Author Posted June 18, 2014 yes , i tried this event "onClientPlayerLogin" but it it doesn't work i still can see the Hud with the login panel . just i want when the player login hud will be visible not before he login in . Failure is simply an opportunity to begin again more intelligently - Henry Ford
Moderators IIYAMA Posted June 18, 2014 Moderators Posted June 18, 2014 It doesn't work, because it doesn't exist, as simple as that. There is only onPlayerLogin at serverside. And why there is no "onClientPlayerLogin" event, that is because registrations will only be done at a place where a database is located. (a place where you save user-names and passwords) All client events: https://wiki.multitheftauto.com/wiki/Cl ... _Functions All server events: https://wiki.multitheftauto.com/wiki/Se ... _Functions Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
SkatCh Posted June 18, 2014 Author Posted June 18, 2014 what are you talking about i didn't undrestand nothing can u explane more or give a solution i don't need Client; server event i know them all but just i want the hud appear when the player join the server in other word when the player click login . Failure is simply an opportunity to begin again more intelligently - Henry Ford
Moderators IIYAMA Posted June 18, 2014 Moderators Posted June 18, 2014 Joins the server? Your solution. addEventHandler("onClientResourceStart",resourceRoot, function() -- do your gui stuff. end) Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
SkatCh Posted June 18, 2014 Author Posted June 18, 2014 i think you don't undrestand what i am talking about , i mean when players join my server they can see the Hud before they login . i tried all events : "onClientHUDRender" "onClientPlayerSpawn" "onClientPlayerJoin" but the problem still exist . Failure is simply an opportunity to begin again more intelligently - Henry Ford
Moderators IIYAMA Posted June 18, 2014 Moderators Posted June 18, 2014 why don't you show the login later? Or are you talking about the moment they are downloading the code? Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Max+ Posted June 18, 2014 Posted June 18, 2014 you can try this, addEventHandler("onPlayerJoin",root, function() for k, v in ipairs({"ammo","weapon","wanted","area_name","vehicle_name","health","money","clock"}) do showPlayerHudComponent(source,v,false) end end ) - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
_DrXenon Posted June 18, 2014 Posted June 18, 2014 OnPlayerLogin (serverside) TriggerClientEvent() Use those functions. If you didnt understand i will explain later.. ●●● Rage Gaming Society Coming Soon ●●●
WASSIm. Posted June 18, 2014 Posted June 18, 2014 you can try this, addEventHandler("onPlayerJoin",root, function() for k, v in ipairs({"ammo","weapon","wanted","area_name","vehicle_name","health","money","clock"}) do showPlayerHudComponent(source,v,false) end end ) he can just do that showPlayerHudComponent(source,"all",false)
Max+ Posted June 18, 2014 Posted June 18, 2014 you can try this, addEventHandler("onPlayerJoin",root, function() for k, v in ipairs({"ammo","weapon","wanted","area_name","vehicle_name","health","money","clock"}) do showPlayerHudComponent(source,v,false) end end ) he can just do that showPlayerHudComponent(source,"all",false) i alredy know , but there was another topic has the same problem , and showPlayerHudComponent(source,"all",false) didn't work with him when players join , He tested what i put above , and it worked, - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
SkatCh Posted June 18, 2014 Author Posted June 18, 2014 why don't you show the login later?Or are you talking about the moment they are downloading the code? it didn't work , just i want the Hud appear when the player start playing . i'm talking about my new hud not Gta sa hud . Failure is simply an opportunity to begin again more intelligently - Henry Ford
Moderators IIYAMA Posted June 18, 2014 Moderators Posted June 18, 2014 start playing = spawn? -- onClientPlayerSpawn or start playing = download is done? -- onClientResourceStart You aren't very clear. addEventHandler("onClientRender",root, functionName) removeEventHandler("onClientRender",root, functionName) Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
SkatCh Posted June 19, 2014 Author Posted June 19, 2014 can any one tell me how can i open and close an event with F11 . i mean i want to use bindKey . Failure is simply an opportunity to begin again more intelligently - Henry Ford
Et-win Posted June 19, 2014 Posted June 19, 2014 can any one tell me how can i open and close an event with F11 .i mean i want to use bindKey . removeEventHandler Though, I would use a variable to enable/disable it. ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
SkatCh Posted June 19, 2014 Author Posted June 19, 2014 can you give me an example . Failure is simply an opportunity to begin again more intelligently - Henry Ford
undefined Posted June 19, 2014 Posted June 19, 2014 handlerExist = false function openClose() if (handlerExist == false) then handlerExist = true addEventHandler("onClientRender",root,functionName) elseif (handlerExist == true) then handlerExist = false removeEventHandler("onClientRender",root,functionName) end end bindKey("F11", "down", openClose)
SkatCh Posted June 19, 2014 Author Posted June 19, 2014 sorry bro it dosent' work . Failure is simply an opportunity to begin again more intelligently - Henry Ford
Et-win Posted June 19, 2014 Posted June 19, 2014 Code I would only use a variable and check or it's 'true'. ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
_DrXenon Posted June 19, 2014 Posted June 19, 2014 By the way, as i understood, he made the HUD not the GTA Hud. so how will "showPlayerHudComponent(source,"all",false)" work..?! his HUD isn't a part of GTA HUD, so the function "showPlayerHudComponents(source,"all",false) will only hide the GTA Hud. ●●● Rage Gaming Society Coming Soon ●●●
SkatCh Posted June 19, 2014 Author Posted June 19, 2014 nvm bro i fix it by my self thx all . Failure is simply an opportunity to begin again more intelligently - Henry Ford
SkatCh Posted June 19, 2014 Author Posted June 19, 2014 guys can anyone help me i want when the player press F11 = hud open , if he press it again F11 = hud close . i tried this one but it just close the Hud . ( Not GTA Hud my own Hud ) addEventHandler( "onClientKey", root, function(button,press) if button == "F11" then removeEventHandler("onClientHUDRender", getRootElement(), HudOpening) else addEventHandler("onClientHUDRender", getRootElement(), HudOpening) end end ) Failure is simply an opportunity to begin again more intelligently - Henry Ford
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