• Problems That Don't Need Their Own Thread v5
    4,111 replies, posted
How do I make an entity impossible to be hit by the physgun and toolgun, but still be detected by other traces? Using self:SetSolid(SOLID_NONE) seems to work, but then GetEyeTrace() doesn't detect it anymore.
This is probably stupid simple, but is there a reason that my DScrollPanel is vibrating? [vid]https://feen.us/i514lnlcok.mp4[/vid]
Seems like you keep updating content, i think happend the same with spawnmenu a while ago where it caused to invalidate layout and then changed it size content again Also check you don't have nothing that lerp the position of scrollbar
Not sure why this isn't working. [CODE] --Server net.Start("Printer_ItemSpawn") print("SENDING ID: "..id) print(self.item) net.WriteEntity(self.item) net.WriteInt(id, 8) net.Broadcast() --Client net.Receive("Printer_ItemSpawn", function() local ent = net.ReadEntity() local id = net.ReadInt(8) ent.ItemDrawnID = id ent.height = 0 ent.StartTime = CurTime() print(ent) print("ID: "..id.." ITEM ID: "..ent.ItemDrawnID) end) [/CODE] The entity prints on the server along with the ID I get a null entity on the client, however the id does print, but ent.ItemDrawnID does not. Why is the entity not getting sent successfully to the client?
[QUOTE=dannyf127;51961637]Not sure why this isn't working. :snip: The entity prints on the server along with the ID I get a null entity on the client, however the id does print, but ent.ItemDrawnID does not. Why is the entity not getting sent successfully to the client?[/QUOTE] If the entity is outside the clients pvs and isn't set to transmit always, it'll be NULL as the client doesn't know it exists.
[QUOTE=bigdogmat;51961702]If the entity is outside the clients pvs and isn't set to transmit always, it'll be NULL as the client doesn't know it exists.[/QUOTE] Outside the client's pvs, what do you mean?
[QUOTE=dannyf127;51961707]Outside the client's pvs, what do you mean?[/QUOTE] [URL="https://developer.valvesoftware.com/wiki/PVS"]https://developer.valvesoftware.com/wiki/PVS[/URL]
[QUOTE=dannyf127;51961707]Outside the client's pvs, what do you mean?[/QUOTE] -snip, fuck-
What exactly does the "developer" convar do? I know that it prints the console on the top left corner, but I also know that that's not all it does, with possibly more things for "developer 2" and "developer 3" etc. So does anybody have a source for what it does?
I believe it's so you know when to enable debugging features in your addons instead of creating your own convar for it.
:snip: Didn't see the next page
[QUOTE=NeatNit;51962851]What exactly does the "developer" convar do? I know that it prints the console on the top left corner, but I also know that that's not all it does, with possibly more things for "developer 2" and "developer 3" etc. So does anybody have a source for what it does?[/QUOTE] Afaik it also seems to output some extra errors about model positioning (stuff like SequenceDurations being out of range), sounds, and materials. I could be wrong though, so can anyone confirm?
[QUOTE=NeatNit;51962851]What exactly does the "developer" convar do? I know that it prints the console on the top left corner, but I also know that that's not all it does, with possibly more things for "developer 2" and "developer 3" etc. So does anybody have a source for what it does?[/QUOTE] [url]https://developer.valvesoftware.com/wiki/Developer[/url]
Why Lerp can't work correctly? Ex. [CODE]Lerp(FrameTime() * 10, 100, 500 )[/CODE] He work so laggy. I want to create sliding effect of armor, like if ply:Armor() > 0 then Lerp with from HP Y position to Armor Y position.
Okay, this is a bit embarrassing because I told someone how to do this a few pages ago and now I can't actually do it myself. I want to make custom language tokens for my tool for obvious reasons, and when I put the file here it works: D:\SteamLibrary\steamapps\common\GarrysMod\garrysmod\resource\localization\en However, when I move the file to my addon, it doesn't work: D:\SteamLibrary\steamapps\common\GarrysMod\garrysmod\addons\advanced_camera\resource\localization\en So obviously gmod doesn't load files at this location from legacy addons (and I haven't tried a .gma). Is there another place I can put my language files, which WOULD work? Edit: tried to pack it in gma, didn't work.
How to make certain player's frictionless? (Like the sv_friction 0 command)
[QUOTE=KO #1;51967830]How to make certain player's frictionless? (Like the sv_friction 0 command)[/QUOTE] You can't by default. What you could do is port the hl2dm movement code from the SDK to lua. [editline]16th March 2017[/editline] Adding onto that, here's the relevant code in the SDK: [URL="https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/game/shared/gamemovement.cpp#L2025"]https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/game/shared/gamemovement.cpp#L2025[/URL]
[QUOTE=Shenesis;51968187]What about [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/language/Add]language.Add[/url] in your tool file? That's what I usually do and it works fine[/QUOTE] It completely defeats the purpose of language strings.
Cross-post from the mysqloo v9 thread, but if anyone is familiar with mysqloo v9: [url]https://facepunch.com/showthread.php?t=1515853&p=51969348&viewfull=1#post51969348[/url]
[QUOTE=NeatNit;51968759]It completely defeats the purpose of language strings.[/QUOTE] If GMod lets you get the language files past the whitelist, it should be possible to manually parse them using Lua
[QUOTE=NeatNit;51968759]It completely defeats the purpose of language strings.[/QUOTE] Localization files can't be loaded from an addon, nor can they be networked to the client with FastDL. I ran into this problem with my addon, and instead opted for a sandboxed language translation system that uses gmod_language callbacks. See here: [url]https://github.com/Kefta/gs_weapons/blob/master/gs_weapons_base/lua/code_gs/gs.lua#L251[/url]
[CODE] if grade == "major" or grade == "lieutenant" or grade == "capitaine" or grade == "commandant" or grade == "commissaire" and LocalPlayer():getDarkRPVar("job") == TEAM_POLICE and LocalPlayer():GetNWBool( "RAID" ) == false then print("ok") end [/CODE] The job check thing doesn't work, what's wrong with my if statement ?
Use Player:Team() for job checks. You are checking the player's job name, not their actual job/team assignment. Also, you can use a key-exists table to make your grade checks more efficient and concise. Ex. [code]-- Outside of the function local tAllowedRanks = { major = true, lieutenant = true, capitaine = true, commandant = true, commissaire = true } -- Inside the function if (tAllowedRanks[grade:lower()]) then local player = LocalPlayer() if (player:Team() == TEAM_POLICE and not player:GetNWBool("RAID")) then print("ok") end end[/code]
Thanks, it works and it's way less messy but I don't understand this line: [CODE]if (tAllowedRanks[grade:lower()]) then[/CODE] What does that mean?
You are indexing the "grade" string (put into lower-case to prevent caps conflicts) in the tAllowedRanks table to check if it's in there. If it is, it will return true, otherwise, it will return nil which evaluates to false. I would read this page on tables here: [url]https://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index2584.html[/url]
How can I disable the sound that plays when flashlight is turned on and off? Hook being PlayerSwitchFlashlight
You can try to see if it's passed thru [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/EntityEmitSound]GM:EntityEmitSound[/url]
[QUOTE=LordNoodles;51970372]How can I disable the sound that plays when flashlight is turned on and off? Hook being PlayerSwitchFlashlight[/QUOTE] This way works too: [url]https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/terrortown/gamemode/player.lua#L277-L292[/url] Very simple solution.
:snip: [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/input/GetKeyName]input.GetKeyName[/url] is a thing and so is [url]https://github.com/garrynewman/garrysmod/blob/master/garrysmod/lua/vgui/dbinder.lua[/url]
-snip-
Sorry, you need to Log In to post a reply to this thread.