Jump to content

Rofl, problem with disabling the clock :(


Recommended Posts

Lol, am i an idiot to fail with the easiest script or is this an error:

i try to disable all components of the HUD. Most of them work, but the clock is still shown.. :?:

The code should be right:

function hudChanger () 
  
    showPlayerHudComponent ( source, "ammo", false ) 
    showPlayerHudComponent ( source, "clock", false ) -- idk why not working 
    showPlayerHudComponent ( source, "weapon", false ) 
    showPlayerHudComponent ( source, "armour", false ) 
    showPlayerHudComponent ( source, "breath", false ) 
    showPlayerHudComponent ( source, "health", false ) 
    showPlayerHudComponent ( source, "money", false ) 
    showPlayerHudComponent ( source, "radar", true ) -- radar should be shown 
    showPlayerHudComponent ( source, "area_name", false ) 
    showPlayerHudComponent ( source, "vehicle_name", false ) 
  
end 
-- rofl 
addEventHandler ( "onPlayerJoin", getRootElement(), hudChanger ) 

Anyone got an idea?

ATM its server-script, Client doesnt work either :(

Edited by Guest
Link to comment

Hm, i got next problem, but i dont want to make a new topic for each problems :

Is there a refresh function?

I made a Gui, in which the Health is shown (100, when player join) but when i get killed, or the Health is decreasing, the value still stay at 100... I think, the Health request must be refreshed like in the scoreboard, but cant filter the right command out :(

Link to comment
lol, would it be overlayed when i place a sidepanel over it?

sidepanel?

I made a Gui, in which the Health is shown (100, when player join) but when i get killed, or the Health is decreasing, the value still stay at 100... I think, the Health request must be refreshed like in the scoreboard

what type of GUI element is it?

Link to comment

what type of GUI element is it?

Sry that i didnt post before:

function clientsideResourceStart () 
  
        -- Create the grid list element 
        local HealthStat = guiCreateGridList ( 0.45, 0.45, 0.15, 0.15, true ) 
        local column = guiGridListAddColumn( HealthStat, "Health", 0.85 ) 
        guiGridListSetItemText ( HealthStat, guiGridListAddRow ( HealthStat ), column, "You are Alive/Dead)", false, false ) 
        local playerHealth = getElementHealth ( getLocalPlayer() ) 
        guiGridListSetItemText ( HealthStat, guiGridListAddRow ( HealthStat ), column, "Your current Health: " .. playerHealth, false, false ) 
    guiGridListSetItemText ( HealthStat, guiGridListAddRow ( HealthStat ), column, "   ", false, false ) --Placeholder 
        guiGridListSetItemText ( HealthStat, guiGridListAddRow ( HealthStat ), column, "Your current Armor:", false, false ) 
  
end 
addEventHandler ( "onClientResourceStart", getRootElement(), clientsideResourceStart, "showhealth", showLocalHealth ) 
  
  
  

Thats my fist try to Show the players Health :D so please, ignore the other scripted waste ;)

Its a small Gui, in the Scoreboard are a lot of refreshing functions, but i dont cheack them all...

sidepanel?

Yes, i solved this problem ;) I meant a bar on the left side, overlaying the clock

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