[QUOTE=>>;39589314]DNumSlider is still valid[/QUOTE]Its still valid, but SetMin, SetMax dont work...
Lol, how do i remove a vgui element? Or how could i make it re-draw the existing element instead of creating a new one when i make a change to the code [URL]http://puu.sh/22Rx6[/URL]
I am done with my sweps and the only problem is deploy,reloading sounds are missing.. I triple-checked it and nothing's wrong with the code O_O
[QUOTE=Mr Cookieman;39590725]I also said that. If you read the message properly, then you would have known that i said this:
I'm getting this error when i press z to remove my entity:
[CODE][ERROR] LuaCmd:1: ')' expected near 's'
1. unknown - LuaCmd:0
[/CODE]
I have no clue what it means. Help would be appreciated :)[/QUOTE]
You're missing a ), which should appear after s. Post your code.
[QUOTE=TheDivinity;39593614]This is something very miniscule, but can someone assist me to stop this error.
[CODE]hook.Add("PropBreak", "DRP_PropBreakGuard", function(a, e)
if !IsValid(e) then return false end
local PhysObj = e:GetPhysicsObject()
if !IsValid(PhysObj) then return false end
constraint.RemoveAll(e)
end)
[/CODE]
[CODE][ERROR] lua/includes/modules/constraint.lua:167: Tried to use invalid object (type IPhysicsObject) (Object was NULL or not of the right type)
EnableCollisions - [C]:-1
SetPhysicsCollisions - lua/includes/modules/constraint.lua:167
RemoveAll - lua/includes/modules/constraint.lua:231
fn - gamemodes/darkrp/gamemode/shared/workarounds.lua:111
unknown - addons/ulib/lua/ulib/shared/hook.lua:168
[/CODE]
I'm just curious, what other safety checks should I be doing exactly?[/QUOTE]
I think that PhysObj:IsValid() is the way for physobjects, IsValid(PhysObj) is specifically for any entity so it doesn't have to mean that the physobj is valid.
I'm trying to find where the Build menu has been disabled in a gamemode I have. I've tried search all the sv_init.lua's and I can't seem to find where it's disabled. Any ideas?
[QUOTE=Mr Cookieman;39589379]I'm getting this error when i press z to remove my entity:
[CODE][ERROR] LuaCmd:1: ')' expected near 's'
1. unknown - LuaCmd:0
[/CODE]
I have no clue what it means. Help would be appreciated :)[/QUOTE]
Are you running Lua from the console or from a file?
Either way post your code
[URL="http://facepunch.com/showthread.php?t=1247460"]How to convert a string to a number?[/URL]
What I'm saying is this: I don't want the byte of the string, if the string is exactly "7" then I want to have the integer 7 returned.
[editline]15th February 2013[/editline]
... same for "0", "1" through "9", "10", "11", "12" ; do I just need an integer, local TrueValue, and set it to 1 if I value == "1" or is there a simpler way?
[QUOTE=luavirusfree;39598170][URL="http://facepunch.com/showthread.php?t=1247460"]How to convert a string to a number?[/URL]
What I'm saying is this: I don't want the byte of the string, if the string is exactly "7" then I want to have the integer 7 returned.[/QUOTE]
[lua]
tonumber("7")
[/lua]
okay, thank you.
[QUOTE=Science;39596576]Its still valid, but SetMin, SetMax dont work...[/QUOTE]
try using SetMinMax, i know for a fact that it works
Does anyone know how to set a second view model in a SWEP? I thought it was something similar to the following but it produces no results:
[lua]
local vm = self.Owner:GetViewModel(1)
vm:SetWeaponModel("model/path/here.mdl", self)
vm:RemoveEffects(EF_NODRAW)
[/lua]
I am drawing a AvatarImage element on the HUD, it works fine with resolution of 64 but anything higher results in this: [url]http://puu.sh/22WRP[/url] code: [url]http://pastebin.com/YXGGzQNy[/url]
[QUOTE=lua_error;39591648]I tried many things, it doesn't read value MAX_POLICE, i don't know why[/QUOTE]
Try changing
[lua]local MAX_POLICE = 0;[/lua]
To
[lua]MAX_POLICE = 0;[/lua]
I still need help preventing certain entities from being drawn clientside. Does anybody know how?
Are they SENTS or entities in the engine?
I know this is really stupid off me because I suspect it's easy, but I need help with setting limits with wiremod... What do I put and where do I put the limits? I change limits using ULX ingame, but when server restarts, it goes back to a high number. I need wire turrets set to 0 for example. Could someone make reasonable limits for each wiremod part?
Thanks :/
[QUOTE=Jongunner;39599858]I know this is really stupid off me because I suspect it's easy, but I need help with setting limits with wiremod... What do I put and where do I put the limits? I change limits using ULX ingame, but when server restarts, it goes back to a high number. I need wire turrets set to 0 for example. Could someone make reasonable limits for each wiremod part?
Thanks :/[/QUOTE]
ULX has a warning right next to the settings that says it doesnt save...its pretty massive [url]http://puu.sh/230Oj[/url] anyways, copy-paste the wire part into your server.cfg [url]http://filesmelt.com/dl/server6.cfg[/url]
[QUOTE=Annoyed Tree;39599552]Are they SENTS or entities in the engine?[/QUOTE]
I'd like to be able to do it for both; entities including players and custom entities as well.
I put this together and haven't tested it, but I doubt it will work:
[lua]local OldDraws = {}
hook.Add("Tick", "noLAG", function()
for k,v in pairs(ents.GetAll()) do
if not OldDraws[v] then
OldDraws[v] = v.Draw
end
if v:GetPos():Distance(LocalPlayer():GetPos()) > 2000 then
v.Draw = function() return end
else
v.Draw = OldDraws[v]
end
end
end)[/lua]
[QUOTE=Benjiko99;39599948]ULX has a warning right next to the settings that says it doesnt save...its pretty massive [url]http://puu.sh/230Oj[/url] anyways, copy-paste the wire part into your server.cfg [url]http://filesmelt.com/dl/server6.cfg[/url][/QUOTE]
Thanks, for a quick reply as well. This is what I needed.
[QUOTE=>>;39599996]I'd like to be able to do it for both; entities including players and custom entities as well.
I put this together and haven't tested it, but I doubt it will work:
[lua]local OldDraws = {}hook.Add("Tick", "noLAG", function() for k,v in pairs(ents.GetAll()) do if not OldDraws[v] then OldDraws[v] = v.Draw end if v:GetPos():Distance(LocalPlayer():GetPos()) > 2000 then v.Draw = function() return end else v.Draw = OldDraws[v] end endend)[/lua][/QUOTE]
Doesn't look to bad to me but I think you might have the key and value mixed up on your table. If it doesn't work try replacing OldDraws[v] with OldDraws[k]
[QUOTE=Annoyed Tree;39600140]Doesn't look to bad to me but I think you might have the key and value mixed up on your table. If it doesn't work try replacing OldDraws[v] with OldDraws[k][/QUOTE]
I actually tested it and it is working. It wouldn't matter which I used for the key/value in the OldDraws table.
[editline]15th February 2013[/editline]
Nevermind, does not work on multi-player.
[QUOTE=jaooe;39598043]Are you running Lua from the console or from a file?
Either way post your code[/QUOTE]
Put it in a pastebin. its the entire init.lua
[QUOTE=>>;39600290]I actually tested it and it is working. It wouldn't matter which I used for the key/value in the OldDraws table.
[editline]15th February 2013[/editline]
Nevermind, does not work on multi-player.[/QUOTE]
Any errors?
[QUOTE=Annoyed Tree;39600572]Any errors?[/QUOTE]
No; it appears to work on some entities but not others. It doesn't work on the prop_vehicle_jeep entities, but it works on certain NPC entities on PERP.
[editline]15th February 2013[/editline]
I think it just won't work on players and vehicles. It works with custom entities.
I've been trying to get my weapons to appear in game and my team system implemented but in the console of gmod it says these jimmy rustling words:
gamemodes/mygamemode/gamemode/init.lua:51: 'then' expected near 'ply'
1. unknown - gamemodes/mygamemode/gamemode/init.lua:0
Couldn't Load Init Script: 'mygamemode/gamemode/init.lua'
[AddCSLuaFile] Couldn't find 'weapons/famas/shared.lua' (<nowhere>)
[AddCSLuaFile] Couldn't find 'weapons/famasscript/shared.lua' (<nowhere>)
[AddCSLuaFile] Couldn't find 'weapons/g36c/shared.lua' (<nowhere>)
[AddCSLuaFile] Couldn't find 'weapons/g36cscript/shared.lua' (<nowhere>)
[AddCSLuaFile] Couldn't find 'weapons/lk05/shared.lua' (<nowhere>)
[AddCSLuaFile] Couldn't find 'weapons/lk05particles/shared.lua' (<nowhere>)
[AddCSLuaFile] Couldn't find 'weapons/lk05script/shared.lua' (<nowhere>)
[AddCSLuaFile] Couldn't find 'weapons/scar/shared.lua' (<nowhere>)
[AddCSLuaFile] Couldn't find 'weapons/scarscript/shared.lua' (<nowhere>)
[AddCSLuaFile] Couldn't find 'weapons/spas-12/shared.lua' (<nowhere>)
KeyValues Error: LoadFromBuffer: missing { in file gamemodes/mygamemode/mygamemode.txt
KeyValues Error: LoadFromBuffer: missing { in file gamemodes/mygamemode/mygamemode.txt
But my txt file seems just fine.
[CODE]"mygamemode.txt"
"Gamemode"
{
"base" "base"
"title" "mygamemode"
}
[/CODE]
I have absolutely no idea what is going on here. I've checked everything in my lua files and I can't seem to find the root of my problem...
Oh, and another statement that rustled my jimmies .-.
"Couldn't include file 'shared.lua' (File not found) (@gamemodes/mygamemode/gamemode/cl_init.lua (line 1))
[QUOTE=Mr Cookieman;39600536]Put it in a pastebin. its the entire init.lua[/QUOTE]
Damnit forgot to include the link. Here it is:
[url]http://pastebin.com/J5MMTDzv[/url]
[QUOTE=joshuadim;39601066]
gamemodes/mygamemode/gamemode/init.lua:51: 'then' expected near 'ply'
1. unknown - gamemodes/mygamemode/gamemode/init.lua:0
[/QUOTE]
I think you might be missing a "then" at the end of your if statement on line 51.
Are you sure you want to start with something like a gamemode instead of an addon?
If my traceres is hitting a displacement, is there any way of still getting the material name?
So what's the deal with the team library and classes? There's some old documentation on the old GM wiki, but that uses Fretta. Meanwhile, the fabulous and completely functional new wiki [URL="http://wiki.garrysmod.com/page/team"]doesn't have a page for the classes[/URL]
Sorry, you need to Log In to post a reply to this thread.