[code]function SWEP:Reload()
self:EmitSound(Sound("weapons/scp_reload.wav"),self:GetPos(), 1, CHAN_AUTO, 1, 25, 0, 10 )
self.Weapon:DefaultReload( ACT_VM_RELOAD );
end[/code]
I am trying to change the reload sound of my swep
when I reloaded, the sound was so loud and distorted that I threw my headset against the wall and it broke
what am I doing wrong, I played the .wav sound file and it sounded just fine
[QUOTE=MGFear;51948882][code]function SWEP:Reload()
self:EmitSound(Sound("weapons/scp_reload.wav"),self:GetPos(), 1, CHAN_AUTO, 1, 25, 0, 10 )
self.Weapon:DefaultReload( ACT_VM_RELOAD );
end[/code]
I am trying to change the reload sound of my swep
when I reloaded, the sound was so loud and distorted that I threw my headset against the wall and it broke
what am I doing wrong, I played the .wav sound file and it sounded just fine[/QUOTE]
You mixed up the arguments: [url]https://wiki.garrysmod.com/page/Entity/EmitSound[/url]
[QUOTE=code_gs;51948956]You mixed up the arguments: [url]https://wiki.garrysmod.com/page/Entity/EmitSound[/url][/QUOTE]
Ok I fixed that with the help of some1 but its still distorted, whatever I try to do,
the sound is a .wav and sounds normal outside gmod
How to control transparency handling?
[img]http://i.imgur.com/jhuxY85.png[/img]
Must be: [img]http://i.imgur.com/oqSqo3b.png[/img]
Anyone know how to center the text of a DLabel?
snip
Silly question time: Is there any way to rotate a textured quad other than using an animated texture?
[QUOTE=LisyFOX;51948850]Thanks, this code works fine! But how make map rotated, I'm tried use surface.DrawTexturedRectRotatedPoint from surface.DrawTexturedRectRotated gmod wiki, but this don't work properly.[/QUOTE]
[QUOTE=LisyFOX;51949096]How to control transparency handling?
[img]http://i.imgur.com/jhuxY85.png[/img]
Must be: [img]http://i.imgur.com/oqSqo3b.png[/img][/QUOTE]
What about these questions?
We have no idea.
You can add to your material "$additive", but i know what you're looking for, and this is not exactly what you're looking, something like gta v iirc
I need to make a condition where a traitor can not pick up new weapons in ttt for the power rounds addon.
[CODE]PlayerCanPickupWeapon = function(Ply, Ent)
if ply:GetRole() ~= ROLE_TRAITOR then return true else return false end
end,[/CODE]
This is the code I have so far but it dosen't seem, to allow either role to pickup weaponry.
[QUOTE=Scu11y;51954992]I need to make a condition where a traitor can not pick up new weapons in ttt for the power rounds addon.
[CODE]PlayerCanPickupWeapon = function(Ply, Ent)
if ply:GetRole() ~= ROLE_TRAITOR then return true else return false end
end,[/CODE]
This is the code I have so far but it dosen't seem, to allow either role to pickup weaponry.[/QUOTE]
Can you give more code context?
[QUOTE=code_gs;51955017]Can you give more code context?[/QUOTE]
[CODE] PowerRounds.AddRound({
Name = "The Hidden",
Gamemode = "TTT",
NameClr = Color(0,0,255,255),
Description = "One of you is cloaked and must kill the others with a crowbar and 500 HP",
DescriptionClr = Color(12,121,255,255),
ServerStart = function()
local tab = player.GetAll()-- Calls all users
randomPly = tab[math.random(1,#tab)] -- Randomly Selects
PrintMessage( HUD_PRINTTALK, "Begining Execution...")--First Error Check
RunConsoleCommand ("ulx","csay", randomPly:Nick(), "Has been chosen as the hidden he will be cloaked shortly PREPARE....")-- Warns Players of hidden
RunConsoleCommand ("ttt_debug_preventwin", "1")-- Suspends TTT Gamemode
timer.Simple( 5, function() RunConsoleCommand ("ulx", "force", "*", "innocent") end )-- Sets Everyone to innocent (PREVENTS TK/ADDS KARMA PENALTY TO DICKNOSES)
PrintMessage( HUD_PRINTTALK, "EVERYONE EXCEPT THE HIDDDEN IS INNOCENT")-- Advises players not to tk
timer.Simple( 9, function() RunConsoleCommand("ulx", "force", randomPly:Nick(), "traitor") end ) -- Sets HIDDDEN as traitor
timer.Simple( 2, function() RunConsoleCommand ("ulx", "cloak", randomPly:Nick(), "105") end )-- Cloaks Hidden
RunConsoleCommand ("ulx", "csay", randomPly:Nick(), "Now wears a cloak as dense as the night")-- Informs Of Cloak
timer.Simple (3, function() RunConsoleCommand ("ulx", "strip", randomPly:Nick()) end )-- Strips Player
timer.Simple (5, function() RunConsoleCommand ("ulx", "give", randomPly:Nick(), "weapon_zm_improvised") end )-- Gives Crowbar
timer.Simple(4, function() RunConsoleCommand ("ulx","hp", randomPly:Nick(), "500") end)-- HP Buffer for hidden
timer.Simple(15,function()RunConsoleCommand ("ttt_debug_preventwin", "0") end )-- Unpause TTT gamemode
timer.Simple(20, function() PrintMessage(HUD_PRINTTALK, "Script Executed Successfully") end )--Complete
end,
PlayerCanPickupWeapon = function(Ply, Ent)
if ply:GetRole() ~= ROLE_TRAITOR then return true else return false end
end,
PlayerShouldTakeDamage = function(Ply, Ent)
if Ply.role == Ent.role then
return false
end
end,
ServerEnd = function() RunConsoleCommand ("ulx", "uncloak", "*")
end
})
[/CODE]
Does that function support PlayerCanPickupWeapon as a key?
[QUOTE=code_gs;51955067]Does that function support PlayerCanPickupWeapon as a key?[/QUOTE]
Not quite sure what you mean. Im rather new to gmod and LUA.
Its an addon to determine if a player can pick up a weapon. I think It may just apply to all players
[QUOTE=Scu11y;51955089]Not quite sure what you mean. Im rather new to gmod and LUA.
Its an addon to determine if a player can pick up a weapon. I think It may just apply to all players[/QUOTE]
PlayerCanPickupWeapon is a GMod hook; you are sending it in to the PowerRounds.AddRound function which might not support it.
[QUOTE=code_gs;51955137]PlayerCanPickupWeapon is a GMod hook; you are sending it in to the PowerRounds.AddRound function which might not support it.[/QUOTE]
It does support the hook for fact. Its used in a different way in another script. It does work as a hook in Powerrounds
[QUOTE=Scu11y;51955148]It does support the hook for fact. Its used in a different way in another script. It does work as a hook in Powerrounds[/QUOTE]
We wouldn't know how to fix your issue without knowing the addon source. Perhaps you should contact the author.
[QUOTE=code_gs;51955160]We wouldn't know how to fix your issue without knowing the addon source. Perhaps you should contact the author.[/QUOTE]
Do you know any basic way to deny a role from picking up a weapon in ttt/gmod?
Use it as a hook, instead: [url]https://wiki.garrysmod.com/page/GM/PlayerCanPickupWeapon[/url]
[QUOTE=code_gs;51955205]Use it as a hook, instead: [url]https://wiki.garrysmod.com/page/GM/PlayerCanPickupWeapon[/url][/QUOTE]
Would it be smart to run it as a think function?
[QUOTE=Scu11y;51955272]Would it be smart to run it as a think function?[/QUOTE]
That's not a function, nor it works like that
[QUOTE=geferon;51955280]That's not a function, not it works like that[/QUOTE]
[CODE]function()
GM:PlayerCanPickupWeapon(Ply)
if ply:GetRole() ~= ROLE_TRAITOR then return true else return false end
[/CODE]
Would this work?
[QUOTE=Scu11y;51955432][CODE]function()
GM:PlayerCanPickupWeapon(Ply)
if ply:GetRole() ~= ROLE_TRAITOR then return true else return false end
[/CODE]
Would this work?[/QUOTE]
It is NOT a function. It is a hook! Use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/hook/Add]hook.Add[/url]
[QUOTE=geferon;51955458]It is NOT a function. It is a hook! Use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/hook/Add]hook.Add[/url][/QUOTE]
[CODE]hook.Add( "PlayerCanPickupWeapon", "hiddenpick", function(ply)
if ply:GetRole() ~= ROLE_TRAITOR then return true else return false end
[/CODE]
Would this be about the right setup?
[QUOTE=Scu11y;51955537][CODE]hook.Add( "PlayerCanPickupWeapon", "hiddenpick", function(ply)
if ply:GetRole() ~= ROLE_TRAITOR then return true else return false end
[/CODE]
Would this be about the right setup?[/QUOTE]
You need to end the function and the parenthesis.
[QUOTE=Promptitude;51955675]You need to end the function and the parenthesis.[/QUOTE]
but otherwise would it work?
Don't return true or you will block other hooks. Only return false. Ex.
[Code]if ply:GetRole () == ROLE_TRAITOR then return false end[/code]
[QUOTE=code_gs;51955886]Don't return true or you will block other hooks. Only return false. Ex.
[Code]if ply:GetRole () == ROLE_TRAITOR then return false end[/code][/QUOTE]
I saw somthing on the wiki page about that. Thanks mate i'm gonna go try it
[QUOTE=LisyFOX;51954247]What about these questions?[/QUOTE]
I think I know what you're wanting, one method is to create a material of the minimap, and a material that is a mask for the gradient. On the minimap material set it's $detail to your mask texture and set $detailblendmode 9 [URL="https://developer.valvesoftware.com/wiki/$detail"]$detail[/URL] then to allow for rotations and movement of the minimap material use [URL="https://developer.valvesoftware.com/wiki/$basetexturetransform"]$basetexturetransform[/URL] and update that however you want.
[QUOTE=Shenesis;51956165]Bumping an ages-old problem that I've been trying to solve. ClientsideModels sometimes seem to lag despite having their positions set in a rendering hook. I tried positioning them in a CreateMove hook but it didn't really work.
[vid]https://my.mixtape.moe/bgqwhy.webm[/vid]
[VID]https://my.mixtape.moe/zbelyo.webm[/VID]
(This is with [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/FollowBone]Entity:FollowBone[/url] but I'm pretty sure this is the same problem)
I've had this issue happen on some servers but not others (I'm not even able to reproduce the issue reliably) so I'm thinking it's a networking issue, perhaps related to interpolation where (I'm talking out of my ass at this point) the player's skeleton lags behind the actual model. With this in mind I tried screwing with net_fakelag, cl_interp, I tried checking if I could get different positions by using different methods ([img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/GetPos]Entity:GetPos[/url], [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/ENTITY/CalcAbsolutePosition]ENT:CalcAbsolutePosition[/url]) but I haven't got a clue. This is a really annoying problem that I've been trying to solve for years.[/QUOTE]
I have also had this same issue for the longest time, but I recently found a solution through trial and error and some luck. It seems to be related to traces, where anything that runs any traces(possibly with lag compensation) that are in the general area will cause the parented entites to 'lag behind' shortly(anything using GetBonePosition for positioning). For instance, in TTT the Radio commands use traces when the menu comes up bound to 'suitzoom'. When you activate that it will lag clientside models behind or ahead.
I tried some stuff out and found the solution that worked for me with entities that follow bone positions/angles:
Basically what you need to do is get the bone position/angles from GetBoneMatrix (then use matrix:GetTranslation() and matrix:GetAngles() )instead of GetBonePosition. That resolved this issue for me, hopefully it works for you/others too!
Good luck!
Sorry, you need to Log In to post a reply to this thread.