• What do you need help with? V3
    6,419 replies, posted
libmysql being wrong or missing shouldn't create this error, post a screenshot of the folder that the dll is in so we can see the path
Ive seen a few old posts about clientside hooks doing nothing but they were never resolved. [code] function ENT:Initialize( ) wep_shop_pos = self:GetPos() print("Set Position") end [/code] Is not doing anything at all. However the server side code is fine.
[QUOTE=Half-Shot;38488192]Ive seen a few old posts about clientside hooks doing nothing but they were never resolved. [code] function ENT:Initialize( ) wep_shop_pos = self:GetPos() print("Set Position") end [/code] Is not doing anything at all. However the server side code is fine.[/QUOTE] [code]function ENT:Initialize() self.BaseClass.Initialize(self) self:SetRenderBounds(Vector(-200, -200, 0), Vector(200, 200, 50)) end[/code] Runs fine for me. (located in cl_init.lua)
[QUOTE=Drakehawke;38488167]libmysql being wrong or missing shouldn't create this error, post a screenshot of the folder that the dll is in so we can see the path[/QUOTE] Will do as soon as I get home.
[SUB]noob question:[/SUB] Where does cl_init.lua go?
Does Entity:SetEyeTarget just not work? I've been trying to get an entity to look in front of itself instead of locking its eyes onto the center of the map, and no matter what I try, it just doesn't want to work. [lua] function ENT:Initialize() self:SetMoveType(MOVETYPE_NONE) self:SetSolid(SOLID_BBOX) self.aimtarget = ents.Create( "info_target" ) local pos = self:GetPos() + Vector(0,0,75) local ang = self:GetAngles():Forward() local tracedata = {} tracedata.start = pos tracedata.endpos = pos+(ang*80) tracedata.filter = self local trace = util.TraceLine(tracedata) self.aimtarget:SetPos(trace.HitPos) self.aimtarget:SetParent(self) self.aimtarget:Spawn() self:DeleteOnRemove(self.aimtarget) //spawn a melon at the aimtarget to make sure it exists self.determiner = ents.Create( "prop_physics" ) self.determiner:SetPos(self.aimtarget:GetPos()) self.determiner:SetModel( "models/props_junk/watermelon01.mdl" ) self.determiner:Spawn() self:DeleteOnRemove(self.determiner) self:SetEyeTarget(self.aimtarget:GetPos()) //these aren't related to the eye posing self:Think() self:LoopAnimation() end [/lua] The melon appears in the place the model [I]should[/I] be looking, so the aimtarget is spawning correctly, but the model just won't move its eyes. What am I doing wrong here? Is SetEyeTarget just broken? Am I using it wrong? What?
This is annoying me a bit, I've got a laser pointer and I want to make it follow the view model when it's on the local player. vm:GetAttachment(1).Ang seems to get the local angles, and if I add the Forward() of that angle to the aim vector, I get it following the view model pretty convincingly. This works fine for the HL2 shotgun as the muzzle attachment actually points to the middle of the screen. However, because the CS:S view models suck balls, I have to somehow offset the direction the laser pointer is going. This is what I have now: [url]http://pb.luahelp.com/554[/url] With that addAngle value, I was trying to add another Angle value to it which it would get from weapon (SWEP.LaserOffset), I've tried adding the angle value straight onto it but it just fucks up the result completely. I basically would need a way of doing the angle offset as if it was coming from the origin of the trace (I think). Any ideas?
[QUOTE=darage;38488737][SUB]noob question:[/SUB] Where does cl_init.lua go?[/QUOTE] Depends on what it's for. Addon? Gamemode?
[QUOTE=Cyberuben;38486342]I am trying to use gm_tmysql4_win32.dll on my server. In the init.lua of my gamemode I have the following code: [code] require ("tmysql4") [/code] After starting the server and the gamemode, the console returns that it can't find "includes/modules/tmysql4.lua", pointing to line 3, which has the require function. When trying to use "lua_run require ("tmysql4") it returns this: [img]http://puu.sh/1r849[/img] Any help would be appriciated. EDIT: I also tried to rename it to gmsv_tmysql4_win32.dll, but this didn't work either. Maybe I have the wrong libmysql.dll? Where could I find the right one? Got them from here. [url]http://blackawps-glua-modules.googlecode.com/svn/trunk/gm_tmysql4_boost/Release/[/url][/QUOTE] BlackAwps compiled it with the newest version of Virtual Studio for update 151, the 2010 version. You should try to install that on your PC. If it doesn't work, get this one: puu.sh/1qTJ7 Rate me dumb, watch it work. I had the same issue. The version i linked is compiled with VS08 instead of VS10. We'll see what he says.
Do you guys know how to make a spawn icon for a SWEP? I've tried the old gmod way. Did it change? Cause, it didn't work.
[QUOTE=Darkwater124;38489570]Depends on what it's for. Addon? Gamemode?[/QUOTE] Server addon, yeah. Where should I put it?
[QUOTE=Turtle95;38489633]Do you guys know how to make a spawn icon for a SWEP? I've tried the old gmod way. Did it change? Cause, it didn't work.[/QUOTE] [URL="http://nemesis.thewavelength.net/index.php?c=178"]Do you have VTFEdit? Good.[/URL] Take a picture and make it however you like (gimp, or photoshop or whatever). Import into VTFedit, be sure to resize it to whatever size you like, as long as it's a square. I use 256, this image isn't going to take up a lot of real estate so don't make it cartoonishly big. Save as (your name).vtf. Now you need a vmt to go with it. Open your favorite text editing software (notepad or whatever) and paste this. Be sure to add the name of your new vtf [lua]"UnlitGeneric" { "$basetexture" "VGUI/entities/(name of your image goes here. no .vtf, just the name)" "$nolod" 1 "$vertexalpha" 1 "$vertexcolor" 1 }[/lua] Now save that as (name of swep).vmt Good, now move both of those files into materials/vgui/entities and you should be set. If you get black and purple checkerboard, you either probably misspelled the name of your image. try again. Well, thats how I do it anyway.
[QUOTE=Crap-Head;38489611]BlackAwps compiled it with the newest version of Virtual Studio for update 151, the 2010 version. You should try to install that on your PC. If it doesn't work, get this one: puu.sh/1qTJ7 [B]Rate me dumb, watch it work. I had the same issue. The version i linked is compiled with VS08 instead of VS10. We'll see what he says.[/B][/QUOTE] It worked, great!
Fair enough then, I compile all my modules on vs10 and they work fine
Drawing a player model onto my HUD
Wasn't one of Gmod 13's new features being able to use PNGs? How does that work?
[QUOTE=me-name-bob;38490790][URL="http://nemesis.thewavelength.net/index.php?c=178"]Do you have VTFEdit? Good.[/URL] Take a picture and make it however you like (gimp, or photoshop or whatever). Import into VTFedit, be sure to resize it to whatever size you like, as long as it's a square. I use 256, this image isn't going to take up a lot of real estate so don't make it cartoonishly big. Save as (your name).vtf. Now you need a vmt to go with it. Open your favorite text editing software (notepad or whatever) and paste this. Be sure to add the name of your new vtf [lua]"UnlitGeneric" { "$basetexture" "VGUI/entities/(name of your image goes here. no .vtf, just the name)" "$nolod" 1 "$vertexalpha" 1 "$vertexcolor" 1 }[/lua] Now save that as (name of swep).vmt Good, now move both of those files into materials/vgui/entities and you should be set. If you get black and purple checkerboard, you either probably misspelled the name of your image. try again. Well, thats how I do it anyway.[/QUOTE] Thanks! How would you make a kill icon though?
[QUOTE=Darkwater124;38491724]Wasn't one of Gmod 13's new features being able to use PNGs? How does that work?[/QUOTE] :SetImage("image.png") and Material("image.png").
[QUOTE=Darkwater124;38488446][code]function ENT:Initialize() self.BaseClass.Initialize(self) self:SetRenderBounds(Vector(-200, -200, 0), Vector(200, 200, 50)) end[/code] Runs fine for me. (located in cl_init.lua)[/QUOTE] Well that's just odd. I'm just telling the server to send it in a net message so its not a huge problem. Thanks for testing it though.
How to make a traditional addon? like with the info.txt? I know it's supposed to be addon.txt now but I still have no clue.
[QUOTE=Cyberuben;38492015]How to make a traditional addon? like with the info.txt? I know it's supposed to be addon.txt now but I still have no clue.[/QUOTE] What do you mean? If your having trouble laying out the addon.txt then here: [CODE]"AddonInfo" { "name" "Addon name" "version" "Current Version" "up_date" "Date of update" "author_name" "Addon's Author" "author_email" "" "info" "Addon's Info" "override" "0" }[/CODE]
How do you make the game say instead of "env_explosion" killed an npc, that "SENT name" killed npc
What's the best method to sync a ban from Evolve mod across 2+ servers sharing/stacking an srcds installation?
[QUOTE=Trumple;38493319]What's the best method to sync a ban from Evolve mod across 2+ servers sharing/stacking an srcds installation?[/QUOTE] If it's MySQL, independent script (php?) that syncs.
Is there a way to tell if a player, that was previous given from the PlayerConnect hook as a name and IP, is still trying to connect or has cancelled/crashed?
I'm still trying to make a clientside inventory, this is what I have with saving right now: [lua]function SaveInventory() file.Write(gmod.GetGamemode().Name .."/Inventory/".. string.gsub(LocalPlayer():SteamID(), ":", "_") ..".txt", util.TableToJSON( Inventory )) end function GetInventory() Inventory = util.JSONToTable(gmod.GetGamemode().Name .."/Inventory/".. string.gsub(LocalPlayer():SteamID(), ":", "_") ..".txt") print(Inventory) end[/lua] But, when I run GetInventory(), it returns as nil, not as a table. Any help?
[QUOTE=Staneh;38495194]I'm still trying to make a clientside inventory, this is what I have with saving right now: [lua]function SaveInventory() file.Write(gmod.GetGamemode().Name .."/Inventory/".. string.gsub(LocalPlayer():SteamID(), ":", "_") ..".txt", util.TableToJSON( Inventory )) end function GetInventory() Inventory = util.JSONToTable(gmod.GetGamemode().Name .."/Inventory/".. string.gsub(LocalPlayer():SteamID(), ":", "_") ..".txt") print(Inventory) end[/lua] But, when I run GetInventory(), it returns as nil, not as a table. Any help?[/QUOTE] PrintTable(Inventory)? edit: actually you said it returns not as a table, still worth a shot though
It just says nil when I print it.` If I run it with PrintTable(), it just gives me an error it was expecting a table.
[QUOTE=Staneh;38495221]It just says nil when I print it.` If I run it with PrintTable(), it just gives me an error it was expecting a table.[/QUOTE] [lua] function SaveInventory() file.Write(gmod.GetGamemode().Name .."/Inventory/".. string.gsub(LocalPlayer():SteamID(), ":", "_") ..".txt", util.TableToJSON( Inventory )) end function GetInventory() Inventory = util.JSONToTable(gmod.GetGamemode().Name .."/Inventory/".. string.gsub(LocalPlayer():SteamID(), ":", "_") ..".txt") or {} PrintTable(Inventory) end [/lua] You might want to use metatables for your inventory instead. Ex: [lua] local Player = FindMetaTable("Player") if !Player then return end function Player:GetInventory() self.Inventory = util.JSONToTable(file.Read(gmod.GetGamemode().Name .."/Inventory/".. string.gsub(LocalPlayer():SteamID(), ":", "_") ..".txt")) or {} PrintTable(self.Inventory) end hook.Add("PlayerInitialSpawn", "SetupTables", function(ply) ply:GetInventory() end) [/lua]
[QUOTE=brandonj4;38495280][lua] function SaveInventory() file.Write(gmod.GetGamemode().Name .."/Inventory/".. string.gsub(LocalPlayer():SteamID(), ":", "_") ..".txt", util.TableToJSON( Inventory )) end function GetInventory() Inventory = util.JSONToTable(gmod.GetGamemode().Name .."/Inventory/".. string.gsub(LocalPlayer():SteamID(), ":", "_") ..".txt") or {} PrintTable(Inventory) end [/lua] You might want to use metatables for your inventory instead. Ex: [lua] local Player = FindMetaTable("Player") if !Player then return end function Player:GetInventory() self.Inventory = util.JSONToTable(file.Read(gmod.GetGamemode().Name .."/Inventory/".. string.gsub(LocalPlayer():SteamID(), ":", "_") ..".txt")) or {} PrintTable(self.Inventory) end hook.Add("PlayerInitialSpawn", "SetupTables", function(ply) ply:GetInventory() end) [/lua][/QUOTE] Changed it, but didn't change the outcome, still returning nil.
Sorry, you need to Log In to post a reply to this thread.