• Why doesnt this work?
    6 replies, posted
Hud.. [lua]if vzconfig_ammo == false then local HideElementsTable = { --> DarkRP ["DarkRP_HUD"] = true, ["DarkRP_EntityDisplay"] = true, ["DarkRP_ZombieInfo"] = true, ["DarkRP_LocalPlayerHUD"] = true, ["DarkRP_Hungermod"] = true, ["DarkRP_Agenda"] = true, --> GMod ["CHudHealth"] = true, ["CHudBattery"] = true, ["CHudSuitPower"] = true, } elseif vzconfig_ammo == true then local HideElementsTable = { --> DarkRP ["DarkRP_HUD"] = true, ["DarkRP_EntityDisplay"] = true, ["DarkRP_ZombieInfo"] = true, ["DarkRP_LocalPlayerHUD"] = true, ["DarkRP_Hungermod"] = true, ["DarkRP_Agenda"] = true, --> GMod ["CHudHealth"] = true, ["CHudBattery"] = true, ["CHudSuitPower"] = true, ["CHudAmmo"] = true, ["CHudSecondaryAmmo"] = true, } end end[/lua] [editline]24th June 2016[/editline] returns the error [lua][ERROR] addons/vzhud/lua/autorun/client/cl_headinfo.lua:18: 'Whatever2' isn't a valid font 1. SetFont - [C]:-1 2. fn - addons/vzhud/lua/autorun/client/cl_headinfo.lua:18 3. unknown - addons/ulib/lua/ulib/shared/hook.lua:110 [/lua] [editline]24th June 2016[/editline] nothing with font to do tho
Well, what's on line 18 of headinfo? [editline]24th June 2016[/editline] I know it's not really related, but it IS the line giving the error
the font is in cl_init.lua
[QUOTE=SlayerLegendz;50583983]the font is in cl_init.lua[/QUOTE] [ERROR] addons/vzhud/lua/autorun/client/cl_headinfo.lua:18: 'Whatever2' isn't a valid font My crystal ball is out of order this week .. so you have to post the script. You need a valid font .. can't just type "Whatever2"
[QUOTE=SlayerLegendz;50583983]the font is in cl_init.lua[/QUOTE] That doesn't help much - the error is caused by what is on line 18 of cl_headinfo.lua If you could reply with the chunk of code near that area then it will be easier to help Also, unrelated to the error but it's worth getting into the habit of optimising code, the code at the top is very un-optimised - it may be better to do something like: [CODE]local HideElementsTable = { --> DarkRP ["DarkRP_HUD"] = true, ["DarkRP_EntityDisplay"] = true, ["DarkRP_ZombieInfo"] = true, ["DarkRP_LocalPlayerHUD"] = true, ["DarkRP_Hungermod"] = true, ["DarkRP_Agenda"] = true, --> GMod ["CHudHealth"] = true, ["CHudBattery"] = true, ["CHudSuitPower"] = true, } if vzconfig_ammo then HideElementsTable["CHudAmmo"] = true HideElementsTable["CHudSecondaryAmmo"] = true end[/CODE]
The default hud still shows up when i turn vzconfig ammo to true its supposed to be there when vzconfigammo is false
[QUOTE=SlayerLegendz;50584297]The default hud still shows up when i turn vzconfig ammo to true its supposed to be there when vzconfigammo is false[/QUOTE] Then replace [CODE]if vzconfig_ammo then[/CODE] with [CODE]if !vzconfig_ammo then[/CODE] I think that's what you wanted anyway?
Sorry, you need to Log In to post a reply to this thread.