• Problems That Don't Need Their Own Thread v5
    4,111 replies, posted
so i have been making ragdoll entity but it just stays in t-pose and rolls around init file [lua]AddCSLuaFile("cl_init.lua") AddCSLuaFile("shared.lua") include("shared.lua") local drops = { "weapon_pistol", "item_ammo_pistol", "item_ammo_smg1_large" } function ENT:Use( activator, caller ) local drop = ents.Create( drops[ math.random( 1, 3 ) ] ) drop:SetPos( self:GetPos() + Vector( 0, 0, 50 ) ) drop:Spawn() drop:Activate() end function ENT:Initialize() self:SetModel( "models/humans/group03/male_09_bloody.mdl" ) self:SetUseType( SIMPLE_USE ) self:SetNotSolid(true) if ( SERVER ) then self:PhysicsInit( SOLID_VPHYSICS ) end local phys = self:GetPhysicsObject() if ( IsValid( phys ) ) then phys:Wake() end end [/lua] what went wrong?
You cannot have a ragdoll as a custom entity, only a prop_ragdoll. You will need to create the ragdoll with ents.Create and work with that
[url]https://i.gyazo.com/6b8c2d23371fa8511e8959e0dfbb8bb4.mp4[/url] [IMG]https://i.gyazo.com/6b8c2d23371fa8511e8959e0dfbb8bb4.gif[/IMG] Anybody know how I can move a insertion point of a textentry?
[QUOTE=kpjVideo;52494953]Anyone know the easiest way to convert time strings into secs? Example: 6:00 -> 6 minutes or ( 6 * 60 = 360 seconds) 1:00:00 -> 1 hour or ( 60 * 60 = 3600 seconds) [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/string/ToMinutesSeconds]string.ToMinutesSeconds[/url] this would work if only there was something that did the reverse[/QUOTE] Not as easy as a single function but you could just do [URL="wiki.garrysmod.com/page/string/Explode"]wiki.garrysmod.com/page/string/Explode[/URL] with ':' as the separator and then iterate backwards through the table multiplying the values by 60, 60 and 24. [editline]23rd July 2017[/editline] Also can someone teach a noob how you do those fancy wiki links?
[QUOTE=Shorthouse06;52500011] [editline]23rd July 2017[/editline] Also can someone teach a noob how you do those fancy wiki links?[/QUOTE] [t]https://i.gyazo.com/d3961ab1c4aec5fd0d454cc74720f988.gif[/t]
[url]https://wiki.garrysmod.com/page/string/FormattedTime[/url] <-- should help you get started,
Is there a way to know if a player is using their mic serverside? The only thing I could find was GM:PlayerCanHearPlayersVoice, but that seems to run whenever it wants to.
[QUOTE=raubana;52500179]Is there a way to know if a player is using their mic serverside? The only thing I could find was GM:PlayerCanHearPlayersVoice, but that seems to run whenever it wants to.[/QUOTE] I think one of the only ways to do that is to network [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PlayerStartVoice]GM:PlayerStartVoice[/url] and [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PlayerEndVoice]GM:PlayerEndVoice[/url]
[QUOTE=dence47;52500211]I think one of the only ways to do that is to network [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PlayerStartVoice]GM:PlayerStartVoice[/url] and [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PlayerEndVoice]GM:PlayerEndVoice[/url][/QUOTE] Right, but those are both clientside only.
[QUOTE=raubana;52500238]Right, but those are both clientside only.[/QUOTE] Serverside versions don't exist. That'd be something I'd request on GitHub.
Alright, my solution ended up being using net code to have each client send when they've started talking and when they've stopped talking. Another question: how would I stop people from using the "act" console command using GLua?
[QUOTE=raubana;52500589]Alright, my solution ended up being using net code to have each client send when they've started talking and when they've stopped talking. Another question: how would I stop people from using the "act" console command using GLua?[/QUOTE] [url]http://wiki.garrysmod.com/page/GM/PlayerShouldTaunt[/url]
[QUOTE=code_gs;52500619][url]http://wiki.garrysmod.com/page/GM/PlayerShouldTaunt[/url][/QUOTE] Thank you, that works.
Is there a genuine reason why most TTT HUDs use [URL="https://github.com/Facepunch/garrysmod/blob/222de8967fdecb707a5d4463576c0b1561fb46e0/garrysmod/gamemodes/terrortown/gamemode/util.lua#L362-L372"]util.SimpleTime[/URL] instead of [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/os/date]os.date[/url]?
[QUOTE=Sean Bean;52501928]Is there a genuine reason why most TTT HUDs use [URL="https://github.com/Facepunch/garrysmod/blob/222de8967fdecb707a5d4463576c0b1561fb46e0/garrysmod/gamemodes/terrortown/gamemode/util.lua#L362-L372"]util.SimpleTime[/URL] instead of [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/os/date]os.date[/url]?[/QUOTE] Because os.date depends on the system time formatting, plus it takes in account your current location as os.date is always the same for everyone.
Have a question: Props in my server get damaged quite often, as that is part of the game. What would be the best way to damage all props near the original prop that got damaged? As some type of "splash" damage, even if it's not realistic. Basically the problem is people are stacking props 25 wide right inside of each other to make it impossible for others to break in. Any ideas?
[QUOTE=TheCloak;52502406]Have a question: Props in my server get damaged quite often, as that is part of the game. What would be the best way to damage all props near the original prop that got damaged? As some type of "splash" damage, even if it's not realistic. Basically the problem is people are stacking props 25 wide right inside of each other to make it impossible for others to break in. Any ideas?[/QUOTE] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/EntityTakeDamage]GM:EntityTakeDamage[/url] and [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/util/BlastDamageInfo]util.BlastDamageInfo[/url] or [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/util/BlastDamage]util.BlastDamage[/url]
[QUOTE=Gmod4phun;52502430][img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/EntityTakeDamage]GM:EntityTakeDamage[/url] and [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/util/BlastDamageInfo]util.BlastDamageInfo[/url] or [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/util/BlastDamage]util.BlastDamage[/url][/QUOTE] Am I correct in saying BlastDamage deals only with explosive damage? If I wanted to incorporate explosive damage AND bullet damage I should stick with only BlastDamageInfo right?
Most likely yes
Hello everyone, A long time ago i fucked up and edited my sandbox gamemode and i can't find any source to install the sandbox gamemode again. Could anyone please upload the sandbox folder for me? :boxhide: Thank you
Delete gamemode folder, verify game cache
[QUOTE=Gmod4phun;52502584]Delete gamemode folder, verify game cache[/QUOTE] Thanks alot! I didn't know you had this feature on steam :toot:
[QUOTE=geferon;52502346]Because os.date depends on the system time formatting, plus it takes in account your current location as os.date is always the same for everyone.[/QUOTE] Surely that wouldn't matter for a countdown?
I can't seem to figure this out for myself somehow. I have a table of players, and I need to figure out if they all have the same data assigned. Ex: need to know if all players have ply:GetDTInt(1) set to 5
[QUOTE=geferon;52502346]Because os.date depends on the system time formatting, plus it takes in account your current location as os.date is always the same for everyone.[/QUOTE] os.date is just formatting. You're thinking of os.time [editline]24th July 2017[/editline] [QUOTE=Lil_Roach;52503288]I can't seem to figure this out for myself somehow. I have a table of players, and I need to figure out if they all have the same data assigned. Ex: need to know if all players have ply:GetDTInt(1) set to 5[/QUOTE] Use a NetworkVar to make your code more clear -- you should never have to access the datatable directly. [Code]local tPlayers = player.GetAll() for i = 1, #tPlayers do if (tPlayers[i]:GetDTInt(1) ~= 5) then return false end end return true[/code]
Couldn't seem to find a DataGridView element in the vgui list, is there any way I could make something similar to this: [IMG]https://www.codeproject.com/KB/grid/Summary_DataGridView/Article_1.gif[/IMG]
[QUOTE=DahDestroyer;52505807]Couldn't seem to find a DataGridView element in the vgui list, is there any way I could make something similar to this: [IMG]https://www.codeproject.com/KB/grid/Summary_DataGridView/Article_1.gif[/IMG][/QUOTE] [URL="http://wiki.garrysmod.com/page/Category:DListView"]DListView[/URL] looks similar.
[QUOTE=Sean Bean;52505821][URL="http://wiki.garrysmod.com/page/Category:DListView"]DListView[/URL] looks similar.[/QUOTE] I am fully aware of DListView, but the ability to select individual cells is an important feature
[QUOTE=DahDestroyer;52505824]I am fully aware of DListView, but the ability to select individual cells is an important feature[/QUOTE] Then there's [URL="http://wiki.garrysmod.com/page/Category:DTileLayout"]DTileLayout[/URL].
How can you dump [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/http/Fetch]http.Fetch[/url]'s cache?
Sorry, you need to Log In to post a reply to this thread.