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 .
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
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 .
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
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 .
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)
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 .
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?
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 )
_DrXenon Posted June 18, 2014 Posted June 18, 2014 OnPlayerLogin (serverside) TriggerClientEvent() Use those functions. If you didnt understand i will explain later..
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,
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 .
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)
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 .
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.
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)
Et-win Posted June 19, 2014 Posted June 19, 2014 Code I would only use a variable and check or it's 'true'.
_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.
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 )
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