Charan Posted April 25, 2017 Share Posted April 25, 2017 Hello i am new to mta forums and i am facing difficulties WITH THE HUD , I've been searching for almost 2 days and i cant see to find a solution i tried executing commands in server,client side nothing i have my server log below after i changed "setPlayerHudComponentVisible" to "showPlayerHudComponent" some forums showed to use "setPlayerHudComponentVisible" and some showed "showPlayerHudComponent" both seems to do absolute stuff UPGRADING DID'NT SOLVE IT. Spoiler ================================================================== = Multi Theft Auto: San Andreas v1.5.3 ================================================================== = Server name : Charan :English Freeroam Server[MODS] = Server IP address: auto = Server port : 22003 = = Log file : .. 1.5/server/mods/deathmatch/logs/server.log = Maximum players : 700 = HTTP port : 22005 = Voice Chat : Disabled = Bandwidth saving : None ================================================================== [2017-04-25 18:58:02] Resources: 229 loaded, 0 failed [2017-04-25 18:58:03] Starting resources... [2017-04-25 18:58:09] Server minclientversion is now 1.5.3-9.11253.0 [2017-04-25 18:58:16] ERROR: Couldn't find resource neon. Check it exists. [2017-04-25 18:58:16] INFO: =============================================================================== [2017-04-25 18:58:16] INFO: MTA:SA HANDLING EDITOR [hedit.googlecode.com] [2017-04-25 18:58:17] WARNING: hud_gtav/client.lua(Line 110) [Client] showPlayerHudComponent is deprecated and may not work in future versions. Please replace with setPlayerHudComponentVisible before Tuesday. [2017-04-25 18:58:17] Some files in 'hud_gtav' use deprecated functions. [2017-04-25 18:58:17] Use the 'upgrade' command to perform a basic upgrade of resources. [2017-04-25 18:58:18] WARNING: gtavradar/radar.lua(Line 76) [Client] isPedInWater is deprecated and may not work in future versions. Please replace with isElementInWater before Tuesday. [2017-04-25 18:58:18] WARNING: gtavradar/radar.lua(Line 138) [Client] showPlayerHudComponent is deprecated and may not work in future versions. Please replace with setPlayerHudComponentVisible before Tuesday. [2017-04-25 18:58:18] Some files in 'gtavradar' use deprecated functions. [2017-04-25 18:58:18] Use the 'upgrade' command to perform a basic upgrade of resources. [2017-04-25 18:58:19] WARNING: File 'vehicles/cheetah.dff' in resource 'changeme' contains errors. [2017-04-25 18:58:20] Creating new DB table recordsDrift [2017-04-25 18:58:25] WARNING: gtaonline-wasted/wasted.lua(Line 150) [Client] showPlayerHudComponent is deprecated and may not work in future versions. Please replace with setPlayerHudComponentVisible before Tuesday. [2017-04-25 18:58:25] Some files in 'gtaonline-wasted' use deprecated functions. [2017-04-25 18:58:25] Use the 'upgrade' command to perform a basic upgrade of resources. [2017-04-25 18:58:26] Gamemode 'play' started. [2017-04-25 18:58:26] Querying MTA master server... success! (Auto detected IP:106.51.155.89) [2017-04-25 18:58:26] Authorized serial account protection is enabled for the ACL group(s): `Admin` See https://mtasa.com/authserial [2017-04-25 18:58:26] Server started and is ready to accept connections! [2017-04-25 18:58:26] To stop the server, type 'shutdown' or press Ctrl-C [2017-04-25 18:58:26] Type 'help' for a list of commands. [2017-04-25 18:58:26] INFO: =============================================================================== Testing ports... Port 22126 UDP is open. Port 22003 UDP is open. Port 22005 TCP is open. [2017-04-25 18:59:13] Server stopped! [2017-04-25 18:59:13] Stopping resources...................................... [2017-04-25 18:59:13] Closing SQLite3 database Link to comment
Charan Posted April 25, 2017 Author Share Posted April 25, 2017 (edited) i use this plugin called simple_hud (the last one hud mod i tried) i don't use own code also if you want the server is 24/7 so you can see BAD it is Spoiler function drawHud() local screenW,screenH = guiGetScreenSize() local time = getRealTime() local hour = time.hour local minute = time.minute local health = getElementHealth(localPlayer) local armor = getPedArmor(localPlayer) local breath = getPedOxygenLevel(localPlayer) local weapon = getPedWeapon(localPlayer) local weaponname = getWeaponNameFromID(weapon) local currentammo = getPedAmmoInClip(localPlayer) local maxammo = getPedTotalAmmo(localPlayer)-(currentammo) local vehicle = getPedOccupiedVehicle(localPlayer) setPlayerHudComponentVisible("clock",false) setPlayerHudComponentVisible("armour",false) setPlayerHudComponentVisible("breath",false) setPlayerHudComponentVisible("health",false) setPlayerHudComponentVisible("money",false) setPlayerHudComponentVisible("wanted",false) setPlayerHudComponentVisible("weapon",false) setPlayerHudComponentVisible("ammo",false) dxDrawRectangle(screenW * 0.8631 - 3, screenH * 0.0644 - 3, screenW * 0.1175 + 6, screenH * 0.0256 + 6, tocolor(0, 0, 0, 255), false) -- HEALTH dxDrawRectangle(screenW * 0.8631, screenH * 0.0644, screenW * 0.1175, screenH * 0.0256, tocolor(222, 0, 0, 100), false) -- HEALTH dxDrawRectangle(screenW * 0.8631, screenH * 0.0644, screenW * 0.1175/100*health, screenH * 0.0256, tocolor(222, 0, 0, 255), false) -- HEALTH dxDrawRectangle(screenW * 0.8631 - 3, screenH * 0.1011 - 3, screenW * 0.1175 + 6, screenH * 0.0256 + 6, tocolor(0, 0, 0, 255), false) -- ARMOR dxDrawRectangle(screenW * 0.8631, screenH * 0.1011, screenW * 0.1175, screenH * 0.0256, tocolor(122, 122, 122, 100), false) -- ARMOR dxDrawRectangle(screenW * 0.8631, screenH * 0.1011, screenW * 0.1175/100*armor, screenH * 0.0256, tocolor(122, 122, 122, 255), false) -- ARMOR dxDrawText(hour..":"..minute.."", screenW * 0.8631 + 2, screenH * 0.0278 + 2, screenW * 0.9806, screenH * 0.0533, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) -- TIME dxDrawText(hour..":"..minute.."", screenW * 0.8631, screenH * 0.0278, screenW * 0.9806, screenH * 0.0533, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) -- TIME dxDrawText(math.floor(health).."%", screenW * 0.8631 + 2, screenH * 0.0644 + 2, screenW * 0.9806, screenH * 0.0900, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) -- HEALTH dxDrawText(math.floor(health).."%", screenW * 0.8631, screenH * 0.0644, screenW * 0.9806, screenH * 0.0900, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) -- HEALTH dxDrawText(math.floor(armor).."%", screenW * 0.8631 + 2, screenH * 0.1011 + 2, screenW * 0.9806, screenH * 0.1267, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) -- ARMOR dxDrawText(math.floor(armor).."%", screenW * 0.8631, screenH * 0.1011, screenW * 0.9806, screenH * 0.1267, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) -- ARMOR if isElementInWater(localPlayer) or isElementInWater(vehicle) then dxDrawRectangle(screenW * 0.8631 - 3, screenH * 0.1378 - 3, screenW * 0.1175 + 6, screenH * 0.0256 + 6, tocolor(0, 0, 0, 255), false) -- BREATH dxDrawRectangle(screenW * 0.8631, screenH * 0.1378, screenW * 0.1175, screenH * 0.0256, tocolor(222, 222, 0, 100), false) -- BREATH dxDrawRectangle(screenW * 0.8631, screenH * 0.1378, screenW * 0.1175/1000*breath, screenH * 0.0256, tocolor(222, 222, 0, 255), false) -- BREATH dxDrawText(math.floor(breath).."%", screenW * 0.8631 + 2, screenH * 0.1378 + 2, screenW * 0.9806, screenH * 0.1633, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) -- BREATH dxDrawText(math.floor(breath).."%", screenW * 0.8631, screenH * 0.1378, screenW * 0.9806, screenH * 0.1633, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) -- BREATH dxDrawText(weaponname.." | "..currentammo.."/"..maxammo, screenW * 0.8631 + 2, screenH * 0.1744 + 2, screenW * 0.9806, screenH * 0.2000, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) -- AMMO dxDrawText(weaponname.." | "..currentammo.."/"..maxammo, screenW * 0.8631, screenH * 0.1744, screenW * 0.9806, screenH * 0.2000, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) -- AMMO else dxDrawText(weaponname.." | "..currentammo.."/"..maxammo, screenW * 0.8631 + 2, screenH * 0.1744 + 2, screenW * 0.9806, screenH * 0.1300, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) -- AMMO dxDrawText(weaponname.." | "..currentammo.."/"..maxammo, screenW * 0.8631, screenH * 0.1744, screenW * 0.9806, screenH * 0.1300, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) -- AMMO end end addEventHandler("onClientRender",root,drawHud) function deleteHud() setPlayerHudComponentVisible("clock",true) setPlayerHudComponentVisible("armour",true) setPlayerHudComponentVisible("breath",true) setPlayerHudComponentVisible("health",true) setPlayerHudComponentVisible("money",true) setPlayerHudComponentVisible("wanted",true) setPlayerHudComponentVisible("weapon",true) setPlayerHudComponentVisible("ammo",true) end addEventHandler("onClientResourceStop",root,deleteHud) Edited April 25, 2017 by Charan Link to comment
NeXuS™ Posted April 25, 2017 Share Posted April 25, 2017 Use <code> tag instead of spoiler. Link to comment
Charan Posted April 25, 2017 Author Share Posted April 25, 2017 its a long code function drawHud() local screenW,screenH = guiGetScreenSize() local time = getRealTime() local hour = time.hour local minute = time.minute local health = getElementHealth(localPlayer) local armor = getPedArmor(localPlayer) local breath = getPedOxygenLevel(localPlayer) local weapon = getPedWeapon(localPlayer) local weaponname = getWeaponNameFromID(weapon) local currentammo = getPedAmmoInClip(localPlayer) local maxammo = getPedTotalAmmo(localPlayer)-(currentammo) local vehicle = getPedOccupiedVehicle(localPlayer) setPlayerHudComponentVisible("clock",false) setPlayerHudComponentVisible("armour",false) setPlayerHudComponentVisible("breath",false) setPlayerHudComponentVisible("health",false) setPlayerHudComponentVisible("money",false) setPlayerHudComponentVisible("wanted",false) setPlayerHudComponentVisible("weapon",false) setPlayerHudComponentVisible("ammo",false) dxDrawRectangle(screenW * 0.8631 - 3, screenH * 0.0644 - 3, screenW * 0.1175 + 6, screenH * 0.0256 + 6, tocolor(0, 0, 0, 255), false) -- HEALTH dxDrawRectangle(screenW * 0.8631, screenH * 0.0644, screenW * 0.1175, screenH * 0.0256, tocolor(222, 0, 0, 100), false) -- HEALTH dxDrawRectangle(screenW * 0.8631, screenH * 0.0644, screenW * 0.1175/100*health, screenH * 0.0256, tocolor(222, 0, 0, 255), false) -- HEALTH dxDrawRectangle(screenW * 0.8631 - 3, screenH * 0.1011 - 3, screenW * 0.1175 + 6, screenH * 0.0256 + 6, tocolor(0, 0, 0, 255), false) -- ARMOR dxDrawRectangle(screenW * 0.8631, screenH * 0.1011, screenW * 0.1175, screenH * 0.0256, tocolor(122, 122, 122, 100), false) -- ARMOR dxDrawRectangle(screenW * 0.8631, screenH * 0.1011, screenW * 0.1175/100*armor, screenH * 0.0256, tocolor(122, 122, 122, 255), false) -- ARMOR dxDrawText(hour..":"..minute.."", screenW * 0.8631 + 2, screenH * 0.0278 + 2, screenW * 0.9806, screenH * 0.0533, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) -- TIME dxDrawText(hour..":"..minute.."", screenW * 0.8631, screenH * 0.0278, screenW * 0.9806, screenH * 0.0533, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) -- TIME dxDrawText(math.floor(health).."%", screenW * 0.8631 + 2, screenH * 0.0644 + 2, screenW * 0.9806, screenH * 0.0900, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) -- HEALTH dxDrawText(math.floor(health).."%", screenW * 0.8631, screenH * 0.0644, screenW * 0.9806, screenH * 0.0900, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) -- HEALTH dxDrawText(math.floor(armor).."%", screenW * 0.8631 + 2, screenH * 0.1011 + 2, screenW * 0.9806, screenH * 0.1267, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) -- ARMOR dxDrawText(math.floor(armor).."%", screenW * 0.8631, screenH * 0.1011, screenW * 0.9806, screenH * 0.1267, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) -- ARMOR if isElementInWater(localPlayer) or isElementInWater(vehicle) then dxDrawRectangle(screenW * 0.8631 - 3, screenH * 0.1378 - 3, screenW * 0.1175 + 6, screenH * 0.0256 + 6, tocolor(0, 0, 0, 255), false) -- BREATH dxDrawRectangle(screenW * 0.8631, screenH * 0.1378, screenW * 0.1175, screenH * 0.0256, tocolor(222, 222, 0, 100), false) -- BREATH dxDrawRectangle(screenW * 0.8631, screenH * 0.1378, screenW * 0.1175/1000*breath, screenH * 0.0256, tocolor(222, 222, 0, 255), false) -- BREATH dxDrawText(math.floor(breath).."%", screenW * 0.8631 + 2, screenH * 0.1378 + 2, screenW * 0.9806, screenH * 0.1633, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) -- BREATH dxDrawText(math.floor(breath).."%", screenW * 0.8631, screenH * 0.1378, screenW * 0.9806, screenH * 0.1633, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) -- BREATH dxDrawText(weaponname.." | "..currentammo.."/"..maxammo, screenW * 0.8631 + 2, screenH * 0.1744 + 2, screenW * 0.9806, screenH * 0.2000, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) -- AMMO dxDrawText(weaponname.." | "..currentammo.."/"..maxammo, screenW * 0.8631, screenH * 0.1744, screenW * 0.9806, screenH * 0.2000, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) -- AMMO else dxDrawText(weaponname.." | "..currentammo.."/"..maxammo, screenW * 0.8631 + 2, screenH * 0.1744 + 2, screenW * 0.9806, screenH * 0.1300, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) -- AMMO dxDrawText(weaponname.." | "..currentammo.."/"..maxammo, screenW * 0.8631, screenH * 0.1744, screenW * 0.9806, screenH * 0.1300, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) -- AMMO end end addEventHandler("onClientRender",root,drawHud) function deleteHud() setPlayerHudComponentVisible("clock",true) setPlayerHudComponentVisible("armour",true) setPlayerHudComponentVisible("breath",true) setPlayerHudComponentVisible("health",true) setPlayerHudComponentVisible("money",true) setPlayerHudComponentVisible("wanted",true) setPlayerHudComponentVisible("weapon",true) setPlayerHudComponentVisible("ammo",true) end addEventHandler("onClientResourceStop",root,deleteHud) Link to comment
NeXuS™ Posted April 25, 2017 Share Posted April 25, 2017 If this is the whole script, it's not even near to long. Give me a minute, I'm gonna test it. Link to comment
NeXuS™ Posted April 25, 2017 Share Posted April 25, 2017 Works totally fine for me. Btw, you dont have to calculate every variable each frame, so just move them out from the function. 1 Link to comment
Charan Posted April 25, 2017 Author Share Posted April 25, 2017 it just overlaps for me i have screenshot Link to comment
NeXuS™ Posted April 25, 2017 Share Posted April 25, 2017 Do you use any other scripts? 1 Link to comment
Charan Posted April 25, 2017 Author Share Posted April 25, 2017 (edited) idk but i can tell you all my startup items if that helps Edited April 25, 2017 by Charan spelling error Link to comment
NeXuS™ Posted April 25, 2017 Share Posted April 25, 2017 Try stopping every resource (keep the MTA default ones), and restart this hud script, see if it is still not working for you. 1 Link to comment
Charan Posted April 25, 2017 Author Share Posted April 25, 2017 i fixed it it was a plugin called gtaonline_wasted , but i edited it to work with the mods , also thanks Link to comment
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