• What do you need help with? V3
    6,419 replies, posted
[QUOTE=elowin;39560840]Oh, didn't know there was a seperate function for getting the hold type, thanks for that. Still getting the same error though.[/QUOTE] Oh, i dint read your whole code, sorry dint notice before, you missed an end there.
[QUOTE=Benjiko99;39561115]Oh, i dint read your whole code, sorry dint notice before, you missed an end there.[/QUOTE] You mean like this? [code]function SWEP:PrimaryAttack() if(self.Owner:KeyDown(IN_USE)) then if(Weapon.GetHoldType("revolver"))then(self.SetWeaponHoldType("passive"))else(self.SetWeaponHoldType("revolver")) end end[/code] Because that still produces the same error.
[QUOTE=elowin;39561253]You mean like this? [code]function SWEP:PrimaryAttack() if(self.Owner:KeyDown(IN_USE)) then if(Weapon.GetHoldType("revolver"))then(self.SetWeaponHoldType("passive"))else(self.SetWeaponHoldType("revolver")) end end[/code] Because that still produces the same error.[/QUOTE] Well other than that you forgot to change 'Weapon' into 'self', i cant see any other problem. Are you closing the SWEP:PrimaryAttack() too? since i cant see that
[QUOTE=Benjiko99;39561288]Well other than that you forgot to change 'Weapon' into 'self', i cant see any other problem. Are you closing the SWEP:PrimaryAttack() too? since i cant see that[/QUOTE] Yeah, I know for sure that the error is within this snippet of code. And I tried both Weapon and self, but got the error, just posted this one as it was the one I tried last.
[QUOTE=elowin;39561321]Yeah, I know for sure that the error is within this snippet of code. And I tried both Weapon and self, but got the error, just posted this one as it was the one I tried last.[/QUOTE] Then i can just assume the error is not on this line? send the whole function or better the whole file. [editline]12th February 2013[/editline] And send the error again too, the latest one.
Why are my clientside files not including? [code]clientside lua startup! Couldn't include file 'cl_main.lua' (File not found) (@addons/aperbank/lua/autorun/client/cl_aperbank.lua (line 3)) Couldn't include file 'cl_bank.lua' (File not found) (@addons/aperbank/lua/autorun/client/cl_aperbank.lua (line 4)) Couldn't include file 'cl_upgrade.lua' (File not found) (@addons/aperbank/lua/autorun/client/cl_aperbank.lua (line 5)) Couldn't include file 'cl_menu.lua' (File not found) (@addons/aperbank/lua/autorun/client/cl_aperbank.lua (line 6)) Compact freed 745472 bytes Redownloading all lightmaps [Aperture Science|4|STEAM_0:1:20264839] Lua Error: Couldn't include file 'cl_main.lua' (File not found) (@addons/aperbank/lua/autorun/client/cl_aperbank.lua (line 3)) [Aperture Science|4|STEAM_0:1:20264839] Lua Error: Couldn't include file 'cl_bank.lua' (File not found) (@addons/aperbank/lua/autorun/client/cl_aperbank.lua (line 4)) [Aperture Science|4|STEAM_0:1:20264839] Lua Error: Couldn't include file 'cl_upgrade.lua' (File not found) (@addons/aperbank/lua/autorun/client/cl_aperbank.lua (line 5)) [Aperture Science|4|STEAM_0:1:20264839] Lua Error: Couldn't include file 'cl_menu.lua' (File not found) (@addons/aperbank/lua/autorun/client/cl_aperbank.lua (line 6)) [/code] [lua]include("config.lua") include("sh_main.lua") include("cl_main.lua") include("cl_bank.lua") include("cl_upgrade.lua") include("cl_menu.lua")[/lua] All the file names are correct and in the right file.
[QUOTE=Science;39561979]Why are my clientside files not including? [code]clientside lua startup! Couldn't include file 'cl_main.lua' (File not found) (@addons/aperbank/lua/autorun/client/cl_aperbank.lua (line 3)) Couldn't include file 'cl_bank.lua' (File not found) (@addons/aperbank/lua/autorun/client/cl_aperbank.lua (line 4)) Couldn't include file 'cl_upgrade.lua' (File not found) (@addons/aperbank/lua/autorun/client/cl_aperbank.lua (line 5)) Couldn't include file 'cl_menu.lua' (File not found) (@addons/aperbank/lua/autorun/client/cl_aperbank.lua (line 6)) Compact freed 745472 bytes Redownloading all lightmaps [Aperture Science|4|STEAM_0:1:20264839] Lua Error: Couldn't include file 'cl_main.lua' (File not found) (@addons/aperbank/lua/autorun/client/cl_aperbank.lua (line 3)) [Aperture Science|4|STEAM_0:1:20264839] Lua Error: Couldn't include file 'cl_bank.lua' (File not found) (@addons/aperbank/lua/autorun/client/cl_aperbank.lua (line 4)) [Aperture Science|4|STEAM_0:1:20264839] Lua Error: Couldn't include file 'cl_upgrade.lua' (File not found) (@addons/aperbank/lua/autorun/client/cl_aperbank.lua (line 5)) [Aperture Science|4|STEAM_0:1:20264839] Lua Error: Couldn't include file 'cl_menu.lua' (File not found) (@addons/aperbank/lua/autorun/client/cl_aperbank.lua (line 6)) [/code] [lua]include("config.lua") include("sh_main.lua") include("cl_main.lua") include("cl_bank.lua") include("cl_upgrade.lua") include("cl_menu.lua")[/lua] All the file names are correct and in the right file.[/QUOTE] You probably forgot to do AddCSLuaFile, as I don't see the line that says "_x clientside scripts requested." or something around that line..
Fixed it, i knew i forgot something silly. Thank you. [editline]12th February 2013[/editline] Or not... still not working. [code]Garry's Mod http://loading.garrysmod.com/ sandbox gm_flatgrass 2 76561198000795407 Requesting 3 lua files from the server No pure server whitelist. sv_pure = 0 clientside lua startup! Couldn't include file 'cl_main.lua' (File not found) (@addons/aperbank/lua/autorun/client/cl_aperbank.lua (line 3)) Couldn't include file 'cl_bank.lua' (File not found) (@addons/aperbank/lua/autorun/client/cl_aperbank.lua (line 4)) Couldn't include file 'cl_upgrade.lua' (File not found) (@addons/aperbank/lua/autorun/client/cl_aperbank.lua (line 5)) Couldn't include file 'cl_menu.lua' (File not found) (@addons/aperbank/lua/autorun/client/cl_aperbank.lua (line 6)) Compact freed 454656 bytes Redownloading all lightmaps [Aperture Science|6|STEAM_0:1:20264839] Lua Error: Couldn't include file 'cl_main.lua' (File not found) (@addons/aperbank/lua/autorun/client/cl_aperbank.lua (line 3)) [Aperture Science|6|STEAM_0:1:20264839] Lua Error: Couldn't include file 'cl_bank.lua' (File not found) (@addons/aperbank/lua/autorun/client/cl_aperbank.lua (line 4)) [Aperture Science|6|STEAM_0:1:20264839] Lua Error: Couldn't include file 'cl_upgrade.lua' (File not found) (@addons/aperbank/lua/autorun/client/cl_aperbank.lua (line 5)) [Aperture Science|6|STEAM_0:1:20264839] Lua Error: Couldn't include file 'cl_menu.lua' (File not found) (@addons/aperbank/lua/autorun/client/cl_aperbank.lua (line 6)) [/code] Server: [lua]include("config.lua") include("sh_main.lua") include("sv_db.lua") include("sv_bank.lua") include("sv_main.lua") AddCSLuaFile("config.lua") AddCSLuaFile("sh_main.lua") AddCSLuaFile("sv_db.lua") AddCSLuaFile("sv_bank.lua") AddCSLuaFile("sv_main.lua") AddCSLuaFile("autorun/client/cl_AperBank.lua")[/lua] Client: [lua]include("config.lua") include("sh_main.lua") include("cl_main.lua") include("cl_bank.lua") include("cl_upgrade.lua") include("cl_menu.lua")[/lua]
[QUOTE=Benjiko99;39561365]Then i can just assume the error is not on this line? send the whole function or better the whole file. [editline]12th February 2013[/editline] And send the error again too, the latest one.[/QUOTE] I'm pretty sure it's in this part of the file, as it's the only part I myself touched. It's also fuckhuge so I don't really think pasting the whole thing here would be the best of ideas. And the error is still the same as before. [code][ERROR] ...myaddon/lua/weapons/wep_mywep/shared.lua:154: syntax error near 'else' 1. unknown - addons/myaddon/lua/weapons/wep_mywep/shared.lua:0[/code]
[QUOTE=elowin;39562509]I'm pretty sure it's in this part of the file, as it's the only part I myself touched. It's also fuckhuge so I don't really think pasting the whole thing here would be the best of ideas. And the error is still the same as before. [code][ERROR] ...myaddon/lua/weapons/wep_mywep/shared.lua:154: syntax error near 'else' 1. unknown - addons/myaddon/lua/weapons/wep_mywep/shared.lua:0[/code][/QUOTE] Use [url]www.pastebin.com[/url] and i dont know which line is 154, how do you mean youre not even sure? You should know which line that is god damn. Upload the file.
[QUOTE=Benjiko99;39562939]Use [url]www.pastebin.com[/url] and i dont know which line is 154, how do you mean youre not even sure? You should know which line that is god damn. Upload the file.[/QUOTE] [code] if(Weapon.GetHoldType("revolver"))then(self.SetWeaponHoldType("passive"))else(self.SetWeaponHoldType("revolver")) end[/code] That's line 154, sorry I didn't mention that before. If you really need the whole file, [url=http://pastebin.com/j9EGF3eX]then here it is[/url], but I highly doubt you're going to find any problems outside of that snippet I posted.
[QUOTE=Science;39559676]It doesn't say it does. But it does for sure, and I can't have it do that.[/QUOTE] If it does, try putting a random value into an unused GET variable. This will make it think it's loading a different web page, and most servers should ignore it. E.g. [lua]URL="http://website.com/page.php?forcenocache="..math.random(0,1000000)[/lua]
Could anyone provide me with a guide/sample on how to make custom chat commands that run a console command with multiple modes, for example: "utime_enable 0" and "utime enable 1"?
[QUOTE=The-Spy;39564959]Could anyone provide me with a guide/sample on how to make custom chat commands that run a console command with multiple modes, for example: "utime_enable 0" and "utime enable 1"?[/QUOTE] [URL="http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index8519.html"]GM:PlayerSay()[/URL] Check if the text contains a command (people usually prefix commands with "!" or "/" or "\". then process the command). If you want to toggle something on or off you can do [lua] utime = true // utime is enabled function toggleUtime() utime = !utime end [/lua] If you want to set the value of a variable using a chat command process it, grab the value and [lua] tonumber(value) [/lua] If you are entering values though you will have to validate the values. you can use [URL="http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index53ea.html"]string.Explode[/URL] to retrieve each argument separated by spaces, e.g. "!utime enable" or "!utime 1". So, look at string operations and GM:PlayerSay.
I cannot re-explain my problem as i have already done so in a thread i made. Any help with my PhysicsSimulate problem would be infinitely appreciated. Thank you. [url]http://www.facepunch.com/showthread.php?t=1246312[/url]
[QUOTE=Mr Cookieman;39565286]I cannot re-explain my problem as i have already done so in a thread i made. Any help with my PhysicsSimulate problem would be infinitely appreciated. Thank you. [url]http://www.facepunch.com/showthread.php?t=1246312[/url][/QUOTE] Are you taking mass into account? [editline]12th February 2013[/editline] Nevermind, didn't realise you were updating something, sorry.
Is there a way to disable deaths being printed to console in sandbox?
[QUOTE=khuba;39560911]The hook is called "PlayerShouldTaunt", not "PlayerShouldAct".[/QUOTE] Thankyou so much, this fixed it! It was called PlayerShouldAct here: [url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexd101.html[/url]
Is there a better way to write this function? [LUA]function LockCheck() net.Receive( "Lock", function() if ply:Lock() then ( CurTime() + 10 ) ply:UnLock() end end end end[/LUA]
someone give me q uick hand with these broken timers? Thanks! timer.Simple(totime, function(ply)) timer.Simple(0.6, function(ply))
[QUOTE=Triple-X;39567505]Is there a better way to write this function? [LUA]function LockCheck() net.Receive( "Lock", function() if ply:Lock() then ( CurTime() + 10 ) ply:UnLock() end end end end[/LUA][/QUOTE] I'm really confused what you're doing there. CurTime() + 10 doesn't do anything and you're only calling net.Recieve inside the function. And I don't know where you're getting ply from. [editline]12th February 2013[/editline] [QUOTE=buu342;39568153]someone give me q uick hand with these broken timers? Thanks! timer.Simple(totime, function(ply)) timer.Simple(0.6, function(ply))[/QUOTE] [url]http://wiki.garrysmod.com/page/Libraries/timer/Simple?useskin=monobook[/url]
[QUOTE=Triple-X;39567505]Is there a better way to write this function? [LUA]function LockCheck() net.Receive( "Lock", function() if ply:Lock() then ( CurTime() + 10 ) ply:UnLock() end end end end[/LUA][/QUOTE] net.Receive() is like hook, why do you put it inside the function instead of either doing it this way: [lua] function LockCheck() if ply:Lock() then ( CurTime() + 10 ) ply:UnLock() end end net.Receive( "Lock", LockCheck )[/lua] or just [lua] net.Receive( "Lock", function() if ply:Lock() then ( CurTime() + 10 ) ply:UnLock() end end [/lua] I don't know what that CurTime() + 10 is supposed to be doing anyways.
Anyone got a fix for glitchy movement when objects move, for example when map entities move such as a boat it looks like your sliding off of it put you just keep going back.
[QUOTE=Kuro Light;39560799]Set the sequence to the ones that aren't silenced? There's different sequences like idle_silenced and etc.. it's probably playing the silenced ones instead of the non-silenced.[/QUOTE] I currently have code written such as: [lua] local _anim = ACT_VM_RELOAD; if ( self:GetSuppressed( ) ) then _anim = ACT_VM_RELOAD_SILENCED; end[/lua] Which only affects View Models I looked into sequences as you suggested, and I found that using: [lua] local _s = self.Weapon:GetSequence( ) local _n = self.Weapon:GetSequenceName( _s ) print( _s, _n )[/lua] OnDeploy, shows that sequence 12 is draw_unsil for the m4a1. And for the USP, 14 is the same. But, it still shows the suppressor. Applying the same code to Think, yields the same result, showing the sequence is in fact draw_unsil. I played around a bit, and I've tried setting the sequence to idle_unsil, which exists, and the same issue persists. The suppressor stays attached to the world model. Any additional help would be greatly appreciated!! Edit: Even when shooting it says shoot3_unsil but the suppressor stays attached. Edit2: I may need to report this as a bug then-- idle is 0, and idle_unsil is 7, yet there are no differences. This may be a bug within gmod not handling the suppressor properly. I'll explore a few more things before reporting it.
[QUOTE=ExtReMLapin;39560174]Try to find the lines of code that disable the Menu and add a (ServerSide) [lua] if !ply:IsAdmin() [/lua] btw , you should use SandBox as base gamemode[/QUOTE] It's not in sv_init.lua aswell. I've had a good look.
I have a simple question and I wasn't able to find anything useful/updated for Gmod 13. How can I get Networked Variables inside a ENT/SNPC for clientside use? Ex: How many times someone brought something from the NPC(via a menu) and display it above its head?
[QUOTE=soupface;39571745]It's not in sv_init.lua aswell. I've had a good look.[/QUOTE] There are things called hooks, there is one specifcally for disabling the spawnmenu, 5 second google: [lua] local function DisallowSpawnMenu( ) if not LocalPlayer():IsAdmin() then return false end end hook.Add( "SpawnMenuOpen", "DisallowSpawnMenu", DisallowSpawnMenu) [/lua]
[QUOTE=Matt-;39572484]There are things called hooks, there is one specifcally for disabling the spawnmenu, 5 second google: [lua] local function DisallowSpawnMenu( ) if not LocalPlayer():IsAdmin() then return false end end hook.Add( "SpawnMenuOpen", "DisallowSpawnMenu", DisallowSpawnMenu) [/lua][/QUOTE] Wise as well as handsome, ooh.
I made my MW2 ACR Swep using Mad Cows weapon base and there are no error with codes. but sounds are missing.... [QUOTE] SWEP.Primary.Sound = Sound("Weapon_ACR.Single") /*--------------------------------------------------------- Name: SWEP:Precache() Desc: Use this function to precache stuff. ---------------------------------------------------------*/ function SWEP:Precache() util.PrecacheSound("weapons/mw2acr/acr-1.wav") end[/QUOTE] These are the damn part bugging me.
I have two dpanels that are 640 x 480, they are they don't render a background (as intended), but they do have content on them. If one overlays the other, it stops me from pressing the buttons on the panel that is under the other, causing me issues. Is there a way I can tell gmod to ignore the main panel, and only worry about the buttons, etc, when clicking?
Sorry, you need to Log In to post a reply to this thread.