How would I go about sending a variable to the console?
I wanna do something like:
[CODE]
local somevar = "player"
ply:ConCommand("give", somevar, "weapon_smg")
[/CODE]
[lua]
local function DrawThing()
local trace = LocalPlayer():GetEyeTrace()
cam.Start3D2D( trace.HitPos, trace.HitNormal , 1)
draw.RoundedBox(0, 10, 10, 0, 0, Color(255,255,255,255))
cam.End3D2D()
end
hook.Add("PostDrawOpaqueRenderables", "ssdasd", DrawThing)
[/lua]
[code]
[ERROR] lua/autorun/client/test.lua:4: bad argument #2 to 'Start3D2D' (Angle expected, got userdata)
1. Start3D2D - [C]:-1
2. v - lua/autorun/client/test.lua:4
3. unknown - lua/includes/modules/hook.lua:75
[/code]
Constantly streaming.
[QUOTE=Blackfire76;38650028][lua]
local function DrawThing()
local trace = LocalPlayer():GetEyeTrace()
cam.Start3D2D( trace.HitPos, trace.HitNormal , 1)
draw.RoundedBox(0, 10, 10, 0, 0, Color(255,255,255,255))
cam.End3D2D()
end
hook.Add("PostDrawOpaqueRenderables", "ssdasd", DrawThing)
[/lua]
[code]
[ERROR] lua/autorun/client/test.lua:4: bad argument #2 to 'Start3D2D' (Angle expected, got userdata)
1. Start3D2D - [C]:-1
2. v - lua/autorun/client/test.lua:4
3. unknown - lua/includes/modules/hook.lua:75
[/code]
Constantly streaming.[/QUOTE]
cam.Start3D2D takes a vector, angle and scale, you're giving it two vectors and a scale.
Try trace.HitNormal:Angle(), I *think* that's what you're trying to achieve. If it's not how you want it to look post a picture of how it looks and tell us how you do want it to look.
[ERROR] lua/weapons/mario_fireballs/shared.lua:96: attempt to call global 'ValidEntity' (a nil value)
1. unknown - lua/weapons/mario_fireballs/shared.lua:96
And how do I fix sounds?? Maybe garrysmod doens't have them?
Replace ValidEntity with [lua]IsValid(...)[/lua]
or at the top of the file
ValidEntity = _G.IsValid
It already is IsValid(frball) ... My main concern now is the sounds. I know there's a thread about it, though.
Couldn't include file 'includes\modules\tmysql.lua' (File not found) (@gamemodes/cityrp/gamemode/init.lua (line 7))
[lua]
require("tmysql")
function GM:Initialize()
ErrorNoHalt"----------------------\n"
ErrorNoHalt(os.date().." - Server starting up\n")
ErrorNoHalt"----------------------\n"
local host = self.Config["MySQL Host"]
local username = self.Config["MySQL Username"]
local password = self.Config["MySQL Password"]
local database = self.Config["MySQL Database"]
-- Initialize a connection to the MySQL database.
tmysql.initialize(self.Config["MySQL Host"], self.Config["MySQL Username"], self.Config["MySQL Password"], self.Config["MySQL Database"], 3306, 5, 5)
-- Call the base class function.
return self.BaseClass:Initialize()
end
[/lua]
tmysql, i downloaded v3 and v4 of it (GM 13 versions) and renamed them to gmsv_tmysql.dll but both of them didn't work for this lua, im trying to port applejack ( cider ) gamemode.
I tried lua_run require("tmysql"), it says the module can't be loaded, location that i putted dlls on it is lua/bin. i read 3 facepunch threads about this tmysql modules, but still buggy.
Another error is self.Config ( a nil value )
[editline]30th November 2012[/editline]
[QUOTE=luavirusfree;38650339]It already is IsValid(frball) ... My main concern now is the sounds. I know there's a thread about it, though.[/QUOTE]
As error says its on line 96, there is ValidEntity on that line.
Yeah, I fixed that! Sounds, now!
[QUOTE=!!!WARLOCK!!!;38650346]Couldn't include file 'includes\modules\tmysql.lua' (File not found) (@gamemodes/cityrp/gamemode/init.lua (line 7))
[lua]
require("tmysql")
function GM:Initialize()
ErrorNoHalt"----------------------\n"
ErrorNoHalt(os.date().." - Server starting up\n")
ErrorNoHalt"----------------------\n"
local host = self.Config["MySQL Host"]
local username = self.Config["MySQL Username"]
local password = self.Config["MySQL Password"]
local database = self.Config["MySQL Database"]
-- Initialize a connection to the MySQL database.
tmysql.initialize(self.Config["MySQL Host"], self.Config["MySQL Username"], self.Config["MySQL Password"], self.Config["MySQL Database"], 3306, 5, 5)
-- Call the base class function.
return self.BaseClass:Initialize()
end
[/lua]
tmysql, i downloaded v3 and v4 of it (GM 13 versions) and renamed them to gmsv_tmysql.dll but both of them didn't work for this lua, im trying to port applejack ( cider ) gamemode.
I tried lua_run require("tmysql"), it says the module can't be loaded, location that i putted dlls on it is lua/bin. i read 3 facepunch threads about this tmysql modules, but still buggy.
Another error is self.Config ( a nil value )
[editline]30th November 2012[/editline]
As error says its on line 96, there is ValidEntity on that line.[/QUOTE]
gmsv_tmysql3_win32.dll should be inside lua/bin/ folder
same with
gmsv_tmysql4_win32.dll
tmysql4 doesn't work at the moment, from what I remember. So use tmysql.
[QUOTE=find me;38650384]gmsv_tmysql3_win32.dll should be inside lua/bin/ folder
same with
gmsv_tmysql4_win32.dll
tmysql4 doesn't work at the moment, from what I remember. So use tmysql.[/QUOTE]
By this you mean download tmysql3 and rename it to gmsv_tmysql3_win32.dll? because i renamed it to gmsv_tmysql.dll, thanks i'll try and report status
[editline]30th November 2012[/editline]
Can i get a download link for tmysql3 please? i downloaded one right now says 2.9mb, the one i had was around 30kb
Okay, well related and unrelated. I don't know where else to ask. I read somewhere that TF2 and scripted sounds were broken. The best I can think of is extraction. But how do I change my avatar anymore?
[QUOTE=.\\Shadow};38647944]Doesn't work, COLLISION_GROUP_WEAPON also does not work.[/QUOTE]
[CODE]self:SetCollisionGroup( COLLISION_GROUP_WEAPON )
self:SetTrigger(true)[/CODE]
Something like that.
[url]http://gmodmodules.googlecode.com/svn/trunk/[/url]
Yes rename it to what I have said, this is what I am currently using and it works.
Thanks alot
So... I won't get help to get ep2 sounds to play? I also need to make particle effects move with the projectile.
[QUOTE=luavirusfree;38651407]So... I won't get help to get ep2 sounds to play? I also need to make particle effects move with the projectile.[/QUOTE]
Calm down miss, you need to test it out your self and also [URL="http://lmgtfy.com/?q=get+ep2+sounds+to+play+garrysmod"]ep2 sounds[/URL] [URL="http://lmgtfy.com/?q=make+particle+effects+move+with+the+projectile+garrysmod"]particle effects[/URL] until someone can help you or not.
is there a solution for fixing prediction without killing the player? eg when recording a demo it breaks the prediction for example ( crouching in mid air looks funky )
[vid]http://puu.sh/1w0UP[/vid]
Call :Spawn() on them.
Does anybody know a webpage where there are LUA exercises with solutions?
I seem like I can only learn something through having tasks to do. It should range from the very beginner to the advanced stuff.
[QUOTE=NinjaS;38651576]Calm down miss, you need to test it out your self and also [URL="http://lmgtfy.com/?q=get+ep2+sounds+to+play+garrysmod"]ep2 sounds[/URL] [URL="http://lmgtfy.com/?q=make+particle+effects+move+with+the+projectile+garrysmod"]particle effects[/URL] until someone can help you or not.[/QUOTE]
I am not a "miss". [URL="http://lmgtfy.com/?q=my+balls&l=1"]Sir[/URL].
I also can browse the gcf myself. I have special programs, and my IQ is higher than 30.
[B]EDIT:[/B]
I know this is unrelated, but it has changed since I was last here. How do I change my avatar on here?
Never mind...
[QUOTE=luavirusfree;38655009]I am not a "miss". [URL="http://lmgtfy.com/?q=my+balls&l=1"]Sir[/URL].
I also can browse the gcf myself. I have special programs, and my IQ is higher than 30.[/QUOTE]
Go Google it first then.
[QUOTE=NinjaS;38655147]Go Google it first then.[/QUOTE]
I will, if you follow my link, first.
I have the old Chatsound addon and I'm trying to fix it up for gmod 13. I was getting an error about ValidEntity, but I fixed that with IsValid.
now the addon loads, the console commands are there, but no sounds play.
I also get no errors in the console, and nothing in the logs. Can anyone help?
I should note I know practically nothing about lua (I do know some code though, so I can edit code)
[QUOTE=luavirusfree;38655174]I will, if you follow my link, first.[/QUOTE]
You know this is a thread for what do you need help with? not what are you doing while being dumb, as for your IQ is a child aged 12 1%.
I am sorry, ma'am. I just return stupiditity with idiocracy.
Pw0nageXD: Look for the sound function and search that function on the new wiki.
[QUOTE=xXpyroHatakeXx;38633398]I have a spawnlist in the lua/autorun folder, but it isn't showing up ingame. Here's my lua file, could someone please tell me what noob-ish mistake I'm making?
[code]
local Category = "Okibi's NPCs"
local NPC = { Name = "Hybrid Hunter",
Class = "sent_hhunter",
KeyValues = { citizentype = 4 },
Category = Category }
list.Set( "NPC", "sent_hhunter", NPC )
[/code][/QUOTE]
Anyone?
If that is acceptable, why don't my addons appear ingame?
[b]EdiT:[/b]
By which I mean ALL addons, whether or not I made them.
[QUOTE=luavirusfree;38656804]If that is acceptable, why don't my addons appear ingame?
[b]EdiT:[/b]
By which I mean ALL addons, whether or not I made them.[/QUOTE]
Google it it's been said many times in this thread, Geez you're dumb.
How about A: I have never read all NINETY of these pages. B: I was gone for a long, LONG time. C: I don't give a f**k. E: I hate you now.
Sorry, you need to Log In to post a reply to this thread.