=FAS=Shigawire Posted August 9, 2008 Posted August 9, 2008 (edited) 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 August 9, 2008 by Guest Hosting your MTA:SA server! http://gta-servers.net.
Gamesnert Posted August 9, 2008 Posted August 9, 2008 We might need to check line 4! Projects: Slothbot | Maximap
=FAS=Shigawire Posted August 9, 2008 Author Posted August 9, 2008 lol, would it be overlayed when i place a sidepanel over it? Hosting your MTA:SA server! http://gta-servers.net.
=FAS=Shigawire Posted August 9, 2008 Author Posted August 9, 2008 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 Hosting your MTA:SA server! http://gta-servers.net.
Remp Posted August 9, 2008 Posted August 9, 2008 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?
Gamesnert Posted August 9, 2008 Posted August 9, 2008 In onClientPlayerDamage http://development.mtasa.com/index.php? ... ayerDamage guiSetText(element,getElementHealth(getLocalPlayer()) --Don't forget to change element! -------- Or something like that. And ofcourse some of the other events which include respawn etc. Projects: Slothbot | Maximap
=FAS=Shigawire Posted August 10, 2008 Author Posted August 10, 2008 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 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 Hosting your MTA:SA server! http://gta-servers.net.
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