Jump to content

Hud problem


SkatCh

Recommended Posts

Posted

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

Posted (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 by Guest

USC Informations

Head Staff & Owner Of USC.

Youtube Channel : My Channel

350x20_FFFFFF_FFFFFF_A89999_080404.png

 

Posted

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
Posted

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 

  Tutorials  4x 

 

Posted

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
Posted

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 

  Tutorials  4x 

 

Posted

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
Posted

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 

  Tutorials  4x 

 

Posted

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

Posted

OnPlayerLogin (serverside)

TriggerClientEvent()

Use those functions.

If you didnt understand i will explain later..

 

●●●

Rage Gaming Society

Coming Soon

●●●

Posted
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) 

Omerta Roleplay

Posted
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

Posted
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
Posted

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 

  Tutorials  4x 

 

Posted

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

Posted
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) 

Posted

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

●●●

Posted

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

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...