• What do you need help with? V3
    6,419 replies, posted
nope nvm, sorry! [code]> print(_R.Vector.Normalize)... function: 03947568 [/code] [editline]30th September 2012[/editline] (that's gmod 13)
[QUOTE=Charrax;37857734]Is there a way to make only specific people (Donators, admins or members things like that) be able to choose specific playermodels? This is on Fretta.[/QUOTE] Anyone? I cant even find a function to call for playermodels.
Garry changed it somVector.Normalize doesn't return a new vector but modifies it, you need to ise Vector.GetNormalized instead.
[QUOTE=Chessnut;37863087]Garry changed it somVector.Normalize doesn't return a new vector but modifies it, you need to ise Vector.GetNormalized instead.[/QUOTE] Okay, that makes sense now. I fixed it now. And on another note, how do I cause NPCs to fly back when I kill them? Using SetDamageForce( Vector )with DamageInfo() doesn't do anything
[QUOTE=Persious;37862596]Not the problem, I changed the value of it, but nothing changed.[/QUOTE] is that what the default dnumslider looks like in gmod13?
[QUOTE=highvoltage;37862153]Is it just me or is Vector:Normalize() broken? Running this: [lua]local test = Vector(23,56,39):Normalize()*10[/lua] Gives me this error: [code]attempt to perform arithmetic on a nil value[/code] [editline]30th September 2012[/editline] Okay, so this works fine: [lua]a = Vector( 4, 3, 2 ) a:Normalize() print( a )[/lua] But this: [lua]local vecSub = tr.HitPos-self.Owner:GetShootPos() MsgN("vecSub "..tostring(vecSub)) local vecFinal = vecSub:Normalize()--*10000 MsgN("vecFinal "..tostring(vecFinal)) local phys = tr.Entity:GetPhysicsObject() [/lua] Prints out this: [code]vecSub -119.880371 -1.104706 -49.188019 vecFinal nil[/code] It worked fine in Gmod 12 so something must of been changed[/QUOTE] Normalize now works similar like RotateAroundAxis, see my post for proper use.
Could someone please help me with the Cocaine from Durgz 2.2? When I take the Cocaine, I get the visual high on my HUD and then when it disappears, I still run extremely fast like I'm still on Cocaine but I shouldn't be.
Hey guys, I need help with creating a Derma VGUI for my DarkRP server: [HR][/HR] -I want to create a VGUI that is automatically opened when a new player joins the server. -Basically, it states the rules and a few tips that players will find interesting to have knowledge of. -Then, I want to add two buttons (one that says 'Accept' and one that says 'Decline'). If the user presses 'Accept', then the menu will disappear and the user will be able to play. -If the user presses 'Decline', then the user will get a notification saying that he must accept the rules before he can play. So yeah, it's pretty simple and I'm sure that a shit ton of you guys can get this done in no time. But I, on the other hand, can certainly not. I know C++ and VB, and that's pretty much it. I was looking around for a Derma IDE, and I actually found [URL="http://facepunch.com/showthread.php?t=940310"]Derma Designer[/URL], and then [URL="http://www.facepunch.com/showthread.php?t=1099390"]Gmod IDE[/URL]. I have not tried Gmod IDE yet, but I have tried Derma Designer. I'm trying to find a few guides/tutorials but they are limited. I'm certainly not ASKING anyone to just do this project for me and get it over with, I really won't learn shit and I'll just have to rely on asking people to finish projects for me. I want to learn how to do them by myself, with minimal help. So if there is anyone who could kind of show me the ropes, and give me maybe a small tutorial or like be my tutor, that would be so sick! PM me on FP or email me at [email]haxordee@gmail.com[/email] I really hope someone can aid me in this...
Dammit. Does anybody have any idea why deploy and reload annimations will play on single player, and on hosted server, but not on a dedicated server online? Files are the same all around, but on my hosted server, I just can't get deploy and reload animations to play. I've tried IsFirstTimePredicted, and i'm getting nowhere. No errors, no nothing. Just instead of a deploy animation, the weapon snaps up there in an instant. Reloads don't play at all, the weapon is just instantly ready. This won't do, especially with a rocket launcher.
[QUOTE=ollie;37856034]Hook '[B]aimbot[/B]' Failed: [RunString:26] attempt to concatenate global 'bone' (a table value) I'm outta here.[/QUOTE] lol its for a bot in a game mode when you point at a bone it shoots and moves on
[QUOTE=tigersmith12;37869250]lol its for a bot in a game mode when you point at a bone it shoots and moves on[/QUOTE] How stupid do you expect us to be ? It's obvious that you are trying to code an aimbot, because you can't aim. We have had enough problems with bots/hacks. You should take another look at the lua pil.
[QUOTE=ah;37863508]is that what the default dnumslider looks like in gmod13?[/QUOTE] Yep :)
[QUOTE=haxordee;37866347]Hey guys, I need help with creating a Derma VGUI for my DarkRP server: [HR][/HR] -I want to create a VGUI that is automatically opened when a new player joins the server. -Basically, it states the rules and a few tips that players will find interesting to have knowledge of. -Then, I want to add two buttons (one that says 'Accept' and one that says 'Decline'). If the user presses 'Accept', then the menu will disappear and the user will be able to play. -If the user presses 'Decline', then the user will get a notification saying that he must accept the rules before he can play. So yeah, it's pretty simple and I'm sure that a shit ton of you guys can get this done in no time. But I, on the other hand, can certainly not. I know C++ and VB, and that's pretty much it. I was looking around for a Derma IDE, and I actually found [URL="http://facepunch.com/showthread.php?t=940310"]Derma Designer[/URL], and then [URL="http://www.facepunch.com/showthread.php?t=1099390"]Gmod IDE[/URL]. I have not tried Gmod IDE yet, but I have tried Derma Designer. I'm trying to find a few guides/tutorials but they are limited. I'm certainly not ASKING anyone to just do this project for me and get it over with, I really won't learn shit and I'll just have to rely on asking people to finish projects for me. I want to learn how to do them by myself, with minimal help. So if there is anyone who could kind of show me the ropes, and give me maybe a small tutorial or like be my tutor, that would be so sick! PM me on FP or email me at [email]haxordee@gmail.com[/email] I really hope someone can aid me in this...[/QUOTE] yeaaah right you cant edit a moneyprinter , you cannot make the most basic lua script, but you know c++ ! :v:
Could somebody point me in the general direction, as to how I can spawn my model exactly at the position I'm looking at? The Code I currently have creates it right infront of me, yet I have no idea how to add some distance to it. [code]local ent = ents.Create( "prop_physics" ) ent:SetModel( model_file ) ent:SetPos( self.Owner:EyePos() + (self.Owner:GetAimVector() * 16 ) ) ent:SetAngles( Angle( 0 , 0 , 0 ) ) ent:Spawn( ) ent:SetMoveType( MOVETYPE_NONE )[/code] Maybe this is a bit too complicated to answer here but it would also be helpfull if it would create a "ghost" of my current object where I'm pointing at, like the advanced duplicator tool does. Thanks in advance <3
[QUOTE=Yonnick19;37871127]Could somebody point me in the general direction, as to how I can spawn my model exactly at the position I'm looking at? The Code I currently have creates it right infront of me, yet I have no idea how to add some distance to it. [code]local ent = ents.Create( "prop_physics" ) ent:SetModel( model_file ) ent:SetPos( self.Owner:EyePos() + (self.Owner:GetAimVector() * 16 ) ) ent:SetAngles( Angle( 0 , 0 , 0 ) ) ent:Spawn( ) ent:SetMoveType( MOVETYPE_NONE )[/code] Maybe this is a bit too complicated to answer here but it would also be helpfull if it would create a "ghost" of my current object where I'm pointing at, like the advanced duplicator tool does. Thanks in advance <3[/QUOTE] Try changing the 16
[QUOTE=TheTrueAndy;37873372]Try changing the 16[/QUOTE] Aaah, thank you so much, I learned a bit more about how this code actually works. I had a little bit of trouble trying to figure out how to get the distance to the hit position of my eyetrace but I got it now, thank you! :3 [code] local dist = self.Owner:EyePos():Distance(tr.HitPos) ent:SetPos( self.Owner:EyePos() + (self.Owner:GetAimVector() * dist) )[/code]
[QUOTE=Charrax;37857734]Is there a way to make only specific people (Donators, admins or members things like that) be able to choose specific playermodels? This is on Fretta.[/QUOTE] Last time I will bump my question. Even some functions to call to help with this would be a big help. I am lost.
Can someone please edit this or tell me how to make it spawn on the floor on the map so everyone can pick it up???? [QUOTE]---- Example TTT custom weapon -- First some standard GMod stuff if SERVER then AddCSLuaFile( "shared.lua" ) end if CLIENT then SWEP.PrintName = "AK47" SWEP.Slot = 6 -- add 1 to get the slot number key SWEP.ViewModelFOV = 72 SWEP.ViewModelFlip = true end -- Always derive from weapon_tttbase. SWEP.Base = "weapon_tttbase" --- Standard GMod values SWEP.HoldType = "ar2" SWEP.Primary.Delay = 0.08 SWEP.Primary.Recoil = 1.9 SWEP.Primary.Automatic = true SWEP.Primary.Damage = 20 SWEP.Primary.Cone = 0.025 SWEP.Primary.Ammo = "smg1" SWEP.Primary.ClipSize = 45 SWEP.Primary.ClipMax = 90 SWEP.Primary.DefaultClip = 45 SWEP.Primary.Sound = Sound( "Weapon_AK47.Single" ) SWEP.IronSightsPos = Vector( 6.05, -5, 2.4 ) SWEP.IronSightsAng = Vector( 2.2, -0.1, 0 ) SWEP.ViewModel = "models/weapons/v_rif_ak47.mdl" SWEP.WorldModel = "models/weapons/w_rif_ak47.mdl" --- TTT config values -- Kind specifies the category this weapon is in. Players can only carry one of -- each. Can be: WEAPON_... MELEE, PISTOL, HEAVY, NADE, CARRY, EQUIP1, EQUIP2 or ROLE. -- Matching SWEP.Slot values: 0 1 2 3 4 6 7 8 SWEP.Kind = WEAPON_EQUIP1 -- If AutoSpawnable is true and SWEP.Kind is not WEAPON_EQUIP1/2, then this gun can -- be spawned as a random weapon. Of course this AK is special equipment so it won't, -- but for the sake of example this is explicitly set to false anyway. SWEP.AutoSpawnable = false -- The AmmoEnt is the ammo entity that can be picked up when carrying this gun. SWEP.AmmoEnt = "item_ammo_smg1_ttt" -- CanBuy is a table of ROLE_* entries like ROLE_TRAITOR and ROLE_DETECTIVE. If -- a role is in this table, those players can buy this. SWEP.CanBuy = { ROLE_TRAITOR } -- InLoadoutFor is a table of ROLE_* entries that specifies which roles should -- receive this weapon as soon as the round starts. In this case, none. SWEP.InLoadoutFor = nil -- If LimitedStock is true, you can only buy one per round. SWEP.LimitedStock = false -- If AllowDrop is false, players can't manually drop the gun with Q SWEP.AllowDrop = true -- If IsSilent is true, victims will not scream upon death. SWEP.IsSilent = false -- If NoSights is true, the weapon won't have ironsights SWEP.NoSights = false -- Equipment menu information is only needed on the client if CLIENT then -- Path to the icon material SWEP.Icon = "VGUI/ttt/icon_myserver_ak47" -- Text shown in the equip menu SWEP.EquipMenuData = { type = "Weapon", desc = "Example custom weapon." }; end -- Tell the server that it should download our icon to clients. if SERVER then -- It's important to give your icon a unique name. GMod does NOT check for -- file differences, it only looks at the name. This means that if you have -- an icon_ak47, and another server also has one, then players might see the -- other server's dumb icon. Avoid this by using a unique name. resource.AddFile("materials/VGUI/ttt/icon_myserver_ak47.vmt") end [/QUOTE]
[QUOTE=Smexy Pig;37874232]Can someone please edit this or tell me how to make it spawn on the floor on the map so everyone can pick it up????[/QUOTE] I'm far from an LUA expert but doesn't this tell you what to do: [code]-- If AutoSpawnable is true and SWEP.Kind is not WEAPON_EQUIP1/2, then this gun can -- be spawned as a random weapon. Of course this AK is special equipment so it won't, -- but for the sake of example this is explicitly set to false anyway. SWEP.AutoSpawnable = false[/code]
[QUOTE=Mipje;37870620]yeaaah right you cant edit a moneyprinter , you cannot make the most basic lua script, but you know c++ ! :v:[/QUOTE] Yo shut the fuck up bro this is like my first look at LUA in this game mode, why don't you try to stop flaming me and instead help? No one helped me with that money printer problem I had, but I solved it myself already. I'm gonna ask for whatever the fuck I need help with as well, regardless of people like you who attempt to interrogate me of what I can/can't do.
[QUOTE=haxordee;37876708]Yo shut the fuck up bro this is like my first look at LUA in this game mode, why don't you try to stop flaming me and instead help? No one helped me with that money printer problem I had, but I solved it myself already. I'm gonna ask for whatever the fuck I need help with as well, regardless of people like you who attempt to interrogate me of what I can/can't do.[/QUOTE] You know Lua isn't an abbreviation, right? Also it was simple code and if you actually cared you could see that the money printer amount is a convar. rp_printamount I believe.
I just type LUA because I'm weird like that; but I say it LEWAH like one of those Hawaiian LOOHAUS or some shit. And you think I don't care? [CODE]function ENT:CreateMoneybag() if not ValidEntity(self) then return end if self:IsOnFire() then return end local MoneyPos = self:GetPos() if math.random(1, 22) == 3 then self:BurstIntoFlames() end local amount = GetConVarNumber("mprintamount") if amount == 0 then amount = 250 end[/CODE] I saw after a while that for the printer to print the amount designated for each different printer, then "mprintamount" has to be set at 0 for it to work, or basically "mprintamount" would be disabled.
I've been giving this the good ol' college try, but I can't seem to figure out the issue. The code: init.lua [lua]AddCSLuaFile( "cl_init.lua" ) AddCSLuaFile( "shared.lua" ) include( "shared.lua" ) local function PregameSetup() util.AddNetworkString( "ChangeBuildModeCS" ) end CurrentBuildMode = 1 local function SpawnWithWeapons(ply) if CurrentBuildMode == 1 then ply:RemoveAllItems() ply:Give( "weapon_physgun" ) ply:Give( "gmod_tool" ) ply:Give( "gmod_camera" ) return true elseif CurrentBuildMode == 0 then ply:Give( "weapon_crowbar" ) ply:Give( "weapon_physcannon") ply:Give( "weapon_pistol" ) ply:Give( "weapon_357" ) ply:Give( "weapon_smg1" ) ply:Give( "weapon_ar2" ) ply:Give( "weapon_shotgun" ) ply:Give( "weapon_crossbow" ) ply:Give( "weapon_frag" ) ply:Give( "weapon_rpg" ) return true end end local function ChangeBuildMode(ply) net.Start( "ChangeBuildModeCl", ply ) net.Send(ply) if CurrentBuildMode == 1 then CurrentBuildMode = 0 ply:RemoveAllItems() ply:Give( "weapon_crowbar" ) ply:Give( "weapon_physcannon") ply:Give( "weapon_pistol" ) ply:Give( "weapon_357" ) ply:Give( "weapon_smg1" ) ply:Give( "weapon_ar2" ) ply:Give( "weapon_shotgun" ) ply:Give( "weapon_crossbow" ) ply:Give( "weapon_frag" ) ply:Give( "weapon_rpg" ) print("Build Mode changed to Fight") elseif CurrentBuildMode == 0 then CurrentBuildMode = 1 ply:RemoveAllItems() ply:Give( "weapon_physgun" ) ply:Give( "gmod_tool" ) ply:Give( "gmod_camera" ) print("Build Mode changed to Build") end end concommand.Add( "ChangeBuildMode", ChangeBuildMode ) hook.Add("PlayerLoadout", "Build Mode Special Weapon Spawns", SpawnWithWeapons) hook.Add("Initialize", "Net String Precaching", PregameSetup)[/lua] cl_init.lua [lua]AddCSLuaFile( "shared.lua" ) include( "shared.lua" ) CurrentBuildMode = 1 local TestingForm = vgui.Create( "DForm", DermaPanel ) TestingForm:SetPos( 1060, 760 ) TestingForm:SetSize( 350, 60 ) TestingForm:SetSpacing( 10 ) TestingForm:SetName( "Current Sandbox Mode:" ) TestingForm.Paint = function() surface.SetDrawColor( 255, 100, 15, 255 ) -- I draw a box here to show where the form is outlined surface.DrawOutlinedRect( 0, 0, TestingForm:GetWide(), TestingForm:GetTall() ) end local InfoPanel = vgui.Create( "DPanel", TestingForm ) InfoPanel:SetPos( 8 , 25 ) InfoPanel:SetSize( 120, 25) InfoPanel.Paint = function() surface.SetDrawColor( 50, 50, 50, 255 ) surface.DrawRect( 0, 0, InfoPanel:GetWide(), InfoPanel:GetTall() ) end local BuildText = vgui.Create( "DLabel", InfoPanel ) BuildText:SetPos(15, 8) BuildText:SetColor(Color(255,255,255,255)) BuildText:SetFont("default") BuildText:SizeToContents() local instructiontext = vgui.Create( "DLabel", TestingForm ) instructiontext:SetPos( 8, 52) instructiontext:SetColor(Color(255,255,255,255)) instructiontext:SetFont("default") instructiontext:SetText( "Press Alt (Walk) to switch" ) instructiontext:SizeToContents() net.Recieve( "ChangeBuildModeCl", function(len) print( "recieved" ) if CurrentBuildMode == 1 then CurrentBuildMode = 0 BuildText:SetText( "Fight Mode" ) elseif CurrentBuildMode == 0 then CurrentBuildMode = 1 BuildText:SetText( "Build Mode" ) end end )[/lua] error message: [code][gamemodes/test/gamemode/cl_init.lua:40] attempt to call field 'Recieve' (a nil value) [cpp] Couldn't Load Init Script: 'test/gamemode/cl_init.lua' [/code] The problem: I'm trying to get the "BuildText" text to change based on the "CurrentBuildMode" variable on the client. When the command is entered to make the server-side variable change, I want to send a message through the net libary in order to change the clientside variable and therefore make the text change. It's not working
It's net.Receive, not net.Recieve
I remember long ago that someone came up with a formula for a near perfect camera in a DModelPanel. Would anyone happen still have this?
Hey all, just making a gamemode and am not sure how to overcome this problem... Any help would be awesome. What I want to do is this: When my round starts ( have a round system already), players spawn at a random spawn point which I define, depending on the map. Two players cannot spawn at the same point. So basically, I would have a list of spawnpoints for each map, and on round.start a player spawns at one of those spawn points, and a spawn point can only be taken by one person. If you know how any of this can be done, please show me how. Many thanks.
[QUOTE=nick_9_8;37879882]Hey all, just making a gamemode and am not sure how to overcome this problem... Any help would be awesome.[/QUOTE] Just a hypothetical solution, run after all players have spawned: [lua]-- Shuffle the spawnpoints table spawnpoints = table.Shuffle(spawnpoints); -- Match up each player with one of the shuffled spawnpoints for k, v in pairs(player.GetAll()) do -- Do we have enough spawnpoints? if (not spawnpoints[k]) then -- mother FUCKER error("Couldn't set a round spawn position for " .. tostring(v) .. ": ran out of spawnpoints!"); end v:SetPos(spawnpoints[k]:GetPos()); end[/lua] Given that spawnpoints is a table of, say, custom point entities, which you can then use in PlayerSelectSpawn. (Also, you'd have to copy table.Shuffle out of TTT, or find your own. There're plenty of shuffling algorithms on the Google, like [url=http://developer.coronalabs.com/code/shufflerandomize-tables]this one[/url].) [b]Edit:[/b] Aw, balls, now I just feel dumb. Updated it. Just make sure you place more spawnpoints than your maximum number of players.
[QUOTE=Luni;37880353]Just a hypothetical solution, run after all players have spawned: [lua]-- Shuffle the spawnpoints table spawnpoints = table.Shuffle(spawnpoints); -- Match up each player with one of the shuffled spawnpoints for k, v in pairs(player.GetAll()) do -- boink v:SetPos(spawnpoints[k]:GetPos()); end[/lua] Given that spawnpoints is a table of, say, custom point entities, which you can then use in PlayerSelectSpawn. (Also, you'd have to copy table.Shuffle out of TTT, or find your own. There're plenty of shuffling algorithms on the Google, like [url=http://developer.coronalabs.com/code/shufflerandomize-tables]this one[/url].)[/QUOTE] Gotcha, is it possible you could add me on steam, just need a little help on one part of this. Cheers.
[QUOTE=vexx21322;37879672]I remember long ago that someone came up with a formula for a near perfect camera in a DModelPanel. Would anyone happen still have this?[/QUOTE] [code]min, max = self.Model:GetRenderBounds( ) self.Model:SetPos( ( min + max ) * .5 ) campos = min:Distance( max ) * Vector( .75, .75, .6 )[/code] That's more or less the gist of it.
[QUOTE=Kogitsune;37881010][code]min, max = self.Model:GetRenderBounds( ) self.Model:SetPos( ( min + max ) * .5 ) campos = min:Distance( max ) * Vector( .75, .75, .6 )[/code] That's more or less the gist of it.[/QUOTE] Holy shit thanks
Sorry, you need to Log In to post a reply to this thread.