• Problems That Don't Need Their Own Thread v2.0
    5,020 replies, posted
Try networking the table.
Hey, I've been up all night trying to figure this out. I'm stumped. [CODE]local playerAvatar = vgui.Create("AvatarImage", self) playerAvatar:SetSize(48, 48) playerAvatar:SetPos( 10, self:GetTall() / 2 - playerAvatar:GetTall() / 2) playerAvatar:SetPlayer( LocalPlayer(), 48 )[/CODE] [video=youtube;G7RHzDVsIT4]http://www.youtube.com/watch?v=G7RHzDVsIT4[/video] I cannnot seem find a way to make it transparent. I looked into [URL="http://wiki.garrysmod.com/page/Panel/PaintManual"]PANEL:PaintManual[/URL] but all the other examples I've seen so far were for masks + stencils, which I doubt would be helpful here. Is it possible to retrieve the equivalant of a DImage object from AvatarImage? Thanks.
[QUOTE=Kamshak;47360854]Does anyone know how i can search for mounted game contents from serverside? Clientside it works but oddly, serverside (dedicated server) it does not. CLIENTSIDE [lua] PrintTable({file.Find("models/items/*", "cstrike" )})... { 1: { 1 = cs_gift.dx80.vtx 2 = cs_gift.dx90.vtx 3 = cs_gift.mdl 4 = cs_gift.phy 5 = cs_gift.sw.vtx 6 = cs_gift.vvd } 2: { } } [/lua] SERVERSIDE [lua] PrintTable({file.Find("models/items/*", "cstrike" )})... { 1: { } 2: { } } [/lua] The ID argument seems to only work on client :/ Is there a solution to this?[/QUOTE] Is CS:S content actually mounted on the server?
[QUOTE=Kamshak;47360854]Does anyone know how i can search for mounted game contents from serverside? Clientside it works but oddly, serverside (dedicated server) it does not. The ID argument seems to only work on client :/ Is there a solution to this?[/QUOTE] the onlything i could think off is to use GAME instead. [QUOTE]lua_run PrintTable({file.Find("models/items/cs_*", "GAME" )}) > PrintTable({file.Find("models/items/cs_*", "GAME" )})... 1: 1 = cs_gift.dx80.vtx 2 = cs_gift.dx90.vtx 3 = cs_gift.mdl 4 = cs_gift.phy 5 = cs_gift.sw.vtx 6 = cs_gift.vvd 2: [/QUOTE]
[IMG]http://picload.org/image/cwwwdra/fuckhalos.png[/IMG] Can anyone help me with finding what exactly draws this in the normal Sandbox gamemode? I want to override it in my script. It seems like entities such as the thruster, balloon, etc. never really draw the worldtip/halo in their script, but that there's an additional script somewhere that says if the player is looking at X entity, then draw worldtip/halo around that entity. Whar is it?
[QUOTE=VIoxtar;47361585][IMG]http://picload.org/image/cwwwdra/fuckhalos.png[/IMG] Can anyone help me with finding what exactly draws this in the normal Sandbox gamemode? I want to override it in my script. It seems like entities such as the thruster, balloon, etc. never really draw the worldtip/halo in their script, but that there's an additional script somewhere that says if the player is looking at X entity, then draw worldtip/halo around that entity. Whar is it?[/QUOTE] sandbox\entities\entities\base_gmodentity.lua [lua] function ENT:Think() if ( CLIENT && self:BeingLookedAtByLocalPlayer() && self:GetOverlayText() != "" ) then AddWorldTip( self:EntIndex(), self:GetOverlayText(), 0.5, self:GetPos(), self.Entity ) halo.Add( { self }, Color( 255, 255, 255, 255 ), 1, 1, 1, true, true ) end end [/lua] edit: just realized you meant for only some entities.
[QUOTE=Mrkrabz;47361617]sandbox\entities\entities\base_gmodentity.lua function ENT:Think() if ( CLIENT && self:BeingLookedAtByLocalPlayer() && self:GetOverlayText() != "" ) then AddWorldTip( self:EntIndex(), self:GetOverlayText(), 0.5, self:GetPos(), self.Entity ) halo.Add( { self }, Color( 255, 255, 255, 255 ), 1, 1, 1, true, true ) endend edit: just realized you meant for only some entities.[/QUOTE] i now really want to do you a favor
Is there a hook that is called every time a weapon is being shot?
[QUOTE=tzahush;47361734]Is there a hook that is called every time a weapon is being shot?[/QUOTE] [url]http://wiki.garrysmod.com/page/WEAPON/PrimaryAttack[/url] If I'm not mistaken, is that what you want? Note this will only work for SWEPs.
[QUOTE=VIoxtar;47361747][url]http://wiki.garrysmod.com/page/WEAPON/PrimaryAttack[/url] If I'm not mistaken, is that what you want? Note this will only work for SWEPs.[/QUOTE] What would it return? the player?
[QUOTE=tzahush;47361734]Is there a hook that is called every time a weapon is being shot?[/QUOTE] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/FireBullets]Entity:FireBullets[/url]
[QUOTE=G4MB!T;47361787][img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/FireBullets]Entity:FireBullets[/url][/QUOTE] thanks! :)
A bit new to the whole Gmod addon structure: Is there a way to [I]override[/I] another gamemode weapon (Specifically a base weapon)? I have [LUA]\addons\GrenadeFix\gamemodes\terrortown\entities\weapons\weapon_tttgrenadebase[/LUA] but it isn't registering as active nor are there any errors in console. Any ideas? Thank you
[QUOTE=_Divine;47360977]Hey, I've been up all night trying to figure this out. I'm stumped. [CODE]local playerAvatar = vgui.Create("AvatarImage", self) playerAvatar:SetSize(48, 48) playerAvatar:SetPos( 10, self:GetTall() / 2 - playerAvatar:GetTall() / 2) playerAvatar:SetPlayer( LocalPlayer(), 48 )[/CODE] [video=youtube;G7RHzDVsIT4]http://www.youtube.com/watch?v=G7RHzDVsIT4[/video] I cannnot seem find a way to make it transparent. I looked into [URL="http://wiki.garrysmod.com/page/Panel/PaintManual"]PANEL:PaintManual[/URL] but all the other examples I've seen so far were for masks + stencils, which I doubt would be helpful here. Is it possible to retrieve the equivalant of a DImage object from AvatarImage? Thanks.[/QUOTE] You can get the image from the profile, through XML i guess? for example: [url]http://steamcommunity.com/id/Freeman22/?xml=1&l=english[/url] The variable would be avatarMedium, or avatarFull
The 3d voice effect with PlayerCanHearPlayersVoice - I am just wondering is it possible to change the source position of that? I have speakers around the map and I want it to sound like a players voice is coming from those speakers.
-snip-
Hey guys. For example if i put: ply.data = "data", will it be saved and be able to be used on other lua files? or will i need to include it as well? Since when i try and use that data, it doesn't work.
[QUOTE=tzahush;47362578]Hey guys. For example if i put: ply.data = "data", will it be saved and be able to be used on other lua files? or will i need to include it as well? Since when i try and use that data, it doesn't work.[/QUOTE] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Global/SetGlobalString]Global.SetGlobalString[/url] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Global/GetGlobalString]Global.GetGlobalString[/url]
[QUOTE=r0uge;47362602][img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Global/SetGlobalString]Global.SetGlobalString[/url] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Global/GetGlobalString]Global.GetGlobalString[/url][/QUOTE] Thanks!
Anyone know how I could play an animation for a grenade before throwing it in TTT? Using SWEP:PrimaryAttack() then playing the animations overrides SWEP:GetGrenadeName() which will throw the grenade.
How can i save data spesific to a player ? i mean like i take a police test if im succesfull i wont need to do the cp test again.
[QUOTE=Drakehawke;47361982]The 3d voice effect with PlayerCanHearPlayersVoice - I am just wondering is it possible to change the source position of that? I have speakers around the map and I want it to sound like a players voice is coming from those speakers.[/QUOTE] Also regarding this, is there a way to specify the range for when the drop off should take effect?
function ulx.gang(ply) end local gang = ulx.command( CATEGORY_NAME, "ulx gang", ulx.gang, "!ganggang" ) gang:defaultAccess( ULib.ACCESS_ALL ) gang:help( "gang" ) How to make it use 2 commands ? like !ganggang and !g how
Question about lua structure and files. would files in lua/autorun/server/FOLDERNAME still load? and [code] function ScaleClassDamage( ply, hitgroup, dmginfo ) local DamageScale = 1 PERK_FrontDoor(ply,attacker,dmginfo) PERK_ArmorDependant(ply,attacker,dmginfo) dmginfo:ScaleDamage(DamageScale) end hook.Add("ScalePlayerDamage","Scale Class Damage",ScaleClassDamage) function PERK_FrontDoor(ply,attacker,dmginfo) if TableSearcher(ply.ClassNumber,"FrontDoor") == true then ang1 = ply:GetAngles().y ang2 = attacker:GetAngles().y damageblock = math.random(10,30) if ang1 - ang2 > 45 and ang1 - ang2 < -45 then ply:EmitSound("weapons/fx/rics/ric"..math.random(1,5)..".wav",50,100) attacker:EmitSound("weapons/fx/rics/ric"..math.random(1,5)..".wav",50,100) dmginfo:SubtractDamage(damageblock) end end end function PERK_ArmorDependant(ply,attacker,dmginfo) if TableSearcher(ply.ClassNumber,"ArmorDependant") == true then if ply:Armor() - HiddenScale*dmginfo:GetBaseDamage()*1 > 0 then DamageScale = 0 ply:SetArmor(ply:Armor() - dmginfo:GetBaseDamage()*2) else DamageScale = 10 end end end [/code] Would is still subtract damage and scale the damage or would I have to return it when the PERK_ functions are called?
[QUOTE=ROFLBURGER;47363484]would files in lua/autorun/server/FOLDERNAME still load?[/QUOTE] Not if you don't include them. For similar files in lua/autorun/client/FOLDERNAME you must also AddCSLuaFile them.
Another question regarding lag. I think I would still have to return the DamageScale in PERK_ArmorDependant but im not 100% sure. What would be the least laggiest way to do it? I'm thinking of doing something like this [code] function ScaleClassDamage( ply, hitgroup, dmginfo ) local DamageData = {} DamageData["ply"] = ply DamageData["attacker"] = dmginfo:GetAttacker() DamageData["Damage"] = dmginfo:GetDamage() Damagedata = PERK_ArmorDependant(DamageData) end function PERK_ArmorDependant(DamageData) if TableSearcher(ply.ClassNumber,"ArmorDependant") == true then if ply:Armor() - HiddenScale*dmginfo:GetBaseDamage()*1 > 0 then DamageData["Damage"] = 0 ply:SetArmor(ply:Armor() - dmginfo:GetBaseDamage()*2) else DamageData["Damage"] = DamageData["Damage"] * 10 end end Return DamageData end [/code] How laggy would this method be?
[QUOTE=ROFLBURGER;47363565]Another question regarding lag. I think I would still have to return the DamageScale in PERK_ArmorDependant but im not 100% sure. What would be the least laggiest way to do it? I'm thinking of doing something like this [code] function ScaleClassDamage( ply, hitgroup, dmginfo ) local DamageData = {} DamageData["ply"] = ply DamageData["attacker"] = dmginfo:GetAttacker() DamageData["Damage"] = dmginfo:GetDamage() Damagedata = PERK_ArmorDependant(DamageData) end function PERK_ArmorDependant(DamageData) if TableSearcher(ply.ClassNumber,"ArmorDependant") == true then if ply:Armor() - HiddenScale*dmginfo:GetBaseDamage()*1 > 0 then DamageData["Damage"] = 0 ply:SetArmor(ply:Armor() - dmginfo:GetBaseDamage()*2) else DamageData["Damage"] = DamageData["Damage"] * 10 end end Return DamageData end [/code] How laggy would this method be?[/QUOTE] What makes you think any of it will lag?
How would I set an entity to play a LOOPED animation? I made a custom model to use as an entity, which works, but the animation will not loop, even though I have [CODE] $sequence spin "anims/spin.smd" { loop fps 3.0 } [/CODE] In the QC. In the Lua, I have [CODE] local sequence = self:LookupSequence( "spin" ) self:SetSequence( sequence ) self:SetPlaybackRate( 1.0 ) self.AutomaticFrameAdvance = true [/CODE] but the sequence stops after playing only one time. What am I meant to do to get a continuously looping sequence? [editline]20th March 2015[/editline] By the way, it's my first time even attempting to do an animation, so I'm sure if the code isn't the problem, it'll be the animation itself. [editline]20th March 2015[/editline] It seems to loop okay in HLMV.
Whats the equation to move between 2 vectors? I don't like using LerpVector as it gets really slow when it nears the final point Edit: Nevermind, I'll just remove it when its closer than 10 units
[QUOTE=Exho;47364864]Whats the equation to move between 2 vectors? I don't like using LerpVector as it gets really slow when it nears the final point[/QUOTE] It sounds like you're using LerpVector non-linearly. Show your code.
Sorry, you need to Log In to post a reply to this thread.