Jump to content

Hud problem


SkatCh

Recommended Posts

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 .

Link to comment
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 by Guest
Link to comment
  • Moderators

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

Link to comment

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 .

Link to comment

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 .

Link to comment

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 
  ) 

Link to comment
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) 

Link to comment
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,

Link to comment
  • Moderators

start playing = spawn? -- onClientPlayerSpawn

or start playing = download is done? -- onClientResourceStart

You aren't very clear.

  
 addEventHandler("onClientRender",root, functionName) 
 removeEventHandler("onClientRender",root, functionName) 

Link to comment
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) 

Link to comment

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.

Link to comment

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 ) 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...