• What do you need help with? V3
    6,419 replies, posted
[QUOTE=Hyper Iguana;39716955]What control do you want to disable?[/QUOTE] OK, so right now I have a combo box with "YES" and "NO" in them. If the user selects "YES", then two of the combo boxes above the "YES" and "NO" combo box will be disabled. If the user selects "NO", it will re-enable them. At least that's what I want it to happen.
[QUOTE=Ice Tea;39725919][url]https://developer.valvesoftware.com/wiki/SteamID#Steam_ID_as_a_Steam_Community_ID[/url][/QUOTE] Got it, I was trying to use integers and lua doesn't support 64-bit ints. Converted to string, and removed the first 7 numbers (as it's always the same), now it works perfectly.
I'm using DarkRP and trying to make an entity only available to a certain ulx group. Here is what I'm working with; return ply:GetUserGroup() == "vip" || ply:IsAdmin() end I've also tried; customCheck = function(ply)return ply:IsUserGroup("vip") end This gives no shoutouts in the console, yet it is still available to all players. I'm putting it at the bottom of the entity settings in addentities.lua Any help is much appreciated!
[QUOTE=Nak;39686874]Debug'z/optimize the code. Lots and lots of optimize. The code will force a xml fetch from steam each time someone joins the server. It will basic lag. [u]Now this isn't the most optimized .. but I don't feel like writing 50-100 lines:[/u] [lua]Data = "" http.Fetch("http://steamcommunity.com/gid/<GroupID>/memberslistxml/?xml=1", function(result, size, headers,httpcode) --Alternatively, use "http://steamcommunity.com/groups/<GroupName>/memberslistxml/?xml=1" if size > 0 and httpcode!=200 then //Steam seems to return http 200 each time Data = result print("Fetched data from steam.") else print("Error. Wasn't able to fetch the data from steam. HTTP: "..httpcode) if httpcode==203 then print("Steam have blocked this information.\nYou can try get a steamspi key to fix it, this script dosen't work anymore.") end if httpcode==403 then print("Steam have forbitten this xml.\nYou can try get a steamapi key to fix it, this script don't work anymore.") end if httpcode==418 then print("I'm a Teapot!\nLol .. steam is playing funny today.") end end end) hook.Add("PlayerAuthed", "checkgroup", function(ply) local id = ply:SteamID64() for w in string.gmatch(Data, "<steamID64>(%d+)</steamID64>") do if w == id then ULib.ucl.addUser( ply:SteamID(), {}, {}, "vip" ) end end end)[/lua][/QUOTE] I tried this, to no avail! :<
I have a quick question someone might be able to answer. I recently coded a hud for a DarkRP server (yes its darkrp, but this should be relevant to most game modes), and the hud works fine when I am testing it on a local server, and it works for the most part on the server I have installed it to. However, the custom don't seem to want to show up on the server. I have declared the fonts correctly in the code (otherwise they wouldn't show up locally) and I have put the ttf files in both the fonts folder I made for the game mode and in the fonts folder for gmod. Is there anything I need to do server side to make it distribute the fonts out to the clients that connect to the server? Here is a picture of the hud in question ( on the client side; the server side just has the coolvetica as it is the default): [url]http://cloud-2.steampowered.com/ugc/560968014810346422/221BB50A968DBB641FF62110FE6E934C142256C4/[/url]
Another tip: Weapon:GetPrintName() not Weapon:GetClass()
[QUOTE=Science;39731275]Another tip: Weapon:GetPrintName() not Weapon:GetClass()[/QUOTE] Yeah I haven't gotten around to fixing that yet. Wanted to get the fonts working correctly first. Still works in the meantime. :D No idea how to fix the font problem though?
[QUOTE=fd13;39730956]I have a quick question someone might be able to answer. I recently coded a hud for a DarkRP server (yes its darkrp, but this should be relevant to most game modes), and the hud works fine when I am testing it on a local server, and it works for the most part on the server I have installed it to. However, the custom don't seem to want to show up on the server. I have declared the fonts correctly in the code (otherwise they wouldn't show up locally) and I have put the ttf files in both the fonts folder I made for the game mode and in the fonts folder for gmod. Is there anything I need to do server side to make it distribute the fonts out to the clients that connect to the server? Here is a picture of the hud in question ( on the client side; the server side just has the coolvetica as it is the default): [url]http://cloud-2.steampowered.com/ugc/560968014810346422/221BB50A968DBB641FF62110FE6E934C142256C4/[/url][/QUOTE] If the green "current weapon" bar isn't meant for the ammo counter I'll be disappointed Make sure you've 1) copied the truetype files to the server's resource/fonts/ 2) added them with resource.AddFile() serverside It probably works fine for you because you have the fonts in your own Garry's Mod install but the script isn't telling anyone else to download them
Hello. I was trying to get a autorun script to work. Basically it checks if a ragdoll has been damaged, and if so, create an emitter blood effect. The problem is that it gives me an error related to the DamageInfo, and i cant figure out what is wrong. [code] local NPCsHitEffects = { ["npc_citizen"] = "bloodimpact", ["npc_combine"] = "bloodimpact", ["npc_antlion"] = "AntlionGib", ["npc_crow"] = "Sparks", Default = "bloodimpact", } function RagdollEffect( Entity, Inflictor, Attacker, Amount, DamageInfo) if (!string.find(Entity:GetClass(), "npc_") && !Entity:IsNPC() ) then return false; end local Effect = EffectData() local Origin = DamageInfo:GetDamagePosition() Effect:SetOrigin( Origin ) Effect:SetScale( 1 ) if (NPCsHitEffects[Entity:GetClass()]) then util.Effect( NPCsHitEffects[Entity:GetClass()], Effect ) else util.Effect( NPCsHitEffects.Default, Effect ) end end hook.Add("EntityTakeDamage", "Ragdoll Effect", RagdollEffect) [/code] Thanks!
Can anyone help me out with some custom vgui painting? I'm trying to override the paint function on a DFrame in order to give it a background image, but the background image only draws when certain other ui elements are present - tips, the main menu, etc. Otherwise, the DFrame is transparent. Here's the pertinent code: [lua] MainPanel = vgui.Create("DFrame") -- Create the frame MainPanel:SetPos(ScrW() / 2 - 512, ScrH() / 2 - 310) -- set the frame's position on the screen MainPanel:SetSize(1024, 620) -- set the frame size MainPanel:SetTitle( "" ) -- set the frame title MainPanel.Paint = function() surface.DrawTexturedRect(0,20,1024,600) end MainPanel:SetVisible( true ) -- Make the frame visible MainPanel:MakePopup() -- make the frame popup [/lua]
Sorry, you need to Log In to post a reply to this thread.