Hello,
i have a problem with mysql and pointshop (I have a Linux rootserver).
I have the libmysqlclient.so.18 file in the folder, where srcds_linux and srcds_run is and the gmsv_mysqloo_linux.dll file in /garrysmod/lua/bin/.
I changed pdata to mysql and also typed my mysql password and so on in mysql.lua.
I also imported the pointshop.sql file into my database.
But I still get this error:
[CODE][ERROR] addons/pointshop-master/lua/pointshop/providers/mysql.lua:59: attempt to call method 'GetFallback' (a nil value)
1. GetData - addons/pointshop-master/lua/pointshop/providers/mysql.lua:59
2. GetPlayerData - addons/pointshop-master/lua/pointshop/sv_init.lua:274
3. PS_LoadData - addons/pointshop-master/lua/pointshop/sv_player_extension.lua:102
4. unknown - addons/pointshop-master/lua/pointshop/sv_player_extension.lua:38[/CODE]
I already googled, but there was no solution.
-snip-, last as fuck
For some reason my CreateTeams() function is not working client side. It will create the teams on the server but not on the client. The function says its for both client and server sides too.
------Edit
Fixed
[QUOTE=bran92don;47058253]For some reason my CreateTeams() function is not working client side. It will create the teams on the server but not on the client. The function says its for both client and server sides too.[/QUOTE]
Post your code?
Is there any way to call '[B]exit[/B]' in Lua? [B]RunConsoleCommand [/B]and [B]game.ConsoleCommand[/B] block it (for legitimate reasons), but I'd still like to give my staff team the ability to reset the server with a simple command.
Basically, is there anyway Lua can cleanly shutdown the server?
[QUOTE=Mista Tea;47058584]Is there any way to call '[B]exit[/B]' in Lua? [B]RunConsoleCommand [/B]and [B]game.ConsoleCommand[/B] block it (for legitimate reasons), but I'd still like to give my staff team the ability to reset the server with a simple command.
Basically, is there anyway Lua can cleanly shutdown the server?[/QUOTE]
I think _restart is what you are looking for (server side restart)
[QUOTE=Pandaman09;47058639]I think _restart is what you are looking for (server side restart)[/QUOTE]
That is perfect, thank you very much.
[QUOTE=wauterboi;47054744]
So, I have this continually do traces downwards to simulate bullet drop, and I have the hit entity take damage. How in the world do I make this break glass?[/QUOTE]
[url]https://developer.valvesoftware.com/wiki/Func_breakable_surf#Inputs[/url]
Look at Inputs: Shatter.
(Use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/Fire]Entity:Fire[/url])
Before I get myself knee-deep in the source code, does someone know and can explain in simple terms how [URL=http://wiki.garrysmod.com/page/Category:properties]properties[/URL] work?
Adding some seems to be fairly simple, but how about removing the existing ones?
[QUOTE=Neat-Nit;47058526]Post your code?[/QUOTE]
I figured it out. Was something stupid.
[QUOTE=Neat-Nit;47059029]Before I get myself knee-deep in the source code, does someone know and can explain in simple terms how [URL=http://wiki.garrysmod.com/page/Category:properties]properties[/URL] work?
Adding some seems to be fairly simple, but how about removing the existing ones?[/QUOTE]
You can't remove them, but you can block them via [url]http://wiki.garrysmod.com/page/SANDBOX/CanProperty[/url]
[QUOTE=Neat-Nit;47059029]Before I get myself knee-deep in the source code, does someone know and can explain in simple terms how [URL=http://wiki.garrysmod.com/page/Category:properties]properties[/URL] work?
Adding some seems to be fairly simple, but how about removing the existing ones?[/QUOTE]
Well this is how it adds them:
[lua]
function Add( name, tab )
name = name:lower()
tab.InternalName = name
setmetatable( tab, meta )
List[ name ] = tab
if ( SERVER ) then
util.AddNetworkString( name )
end
end
[/lua]
List is a global variable defined in the module, so to access it you would use properties.List
Then remove it from the table like so:
[lua]
function properties.Remove(name)
properties.List[name] = nil
end
[/lua]
You can also modify a property using this strategy:
[lua]
local modify = properties.List["swag"]
modify.Filter = function( self, ent, ply )
return true
end
[/lua]
EDIT:
No need to get knee-deep in the source code; just gotta dip your toes into the water.
[QUOTE=bobbleheadbob;47059060]EDIT:
No need to get knee-deep in the source code; just gotta dip your toes into the water.[/QUOTE]
Haha, true. Sadly this wasn't the case with [url=http://facepunch.com/showthread.php?t=1448013]changing the default prop spawn menu[/url], where I felt I was neck-deep or so :S
But hey, it worked out in the end! I'll try your suggestions tonight when I get home.
Does anyone know how to make a circular health bar thing? I can't find it anywhere. Like it's a circle but when you take damage the circle unwraps? I guess? I'm drawing a blank here.
[URL="http://www.queness.com/resources/images/webebar/6.jpg"]http://www.queness.com/resources/images/webebar/6.jpg[/URL] This type of shit.
[QUOTE=TheLuaNoob;47061179]Does anyone know how to make a circular health bar thing? I can't find it anywhere. Like it's a circle but when you take damage the circle unwraps? I guess? I'm drawing a blank here.
[URL="http://www.queness.com/resources/images/webebar/6.jpg"]http://www.queness.com/resources/images/webebar/6.jpg[/URL] This type of shit.[/QUOTE]
[QUOTE=bobbleheadbob;47031644]Use [URL="https://dl.dropboxusercontent.com/u/104427432/Scripts/drawarc.lua"]this[/URL] to draw circles if you want the center to be empty sometimes.
That script has an example at the bottom if you need help. If you want a full circle, use startangle and endangle 0 and 359[/QUOTE]
*snip*
[QUOTE=bobbleheadbob;47061589]-quotes-[/QUOTE]
I've used those functions you gave me, but when I used the test_arc concommand, it just made me start lagging after some time and nothing showed up on my screen...
How, from an initial vector let's say [I]pos1[/I] I would calculate [I]pos2[/I], a vector that needs to be 50 units away from [I]pos1[/I] with an angle of Angle(0, 45, 0).
[I]No need to remind me how dumb I am for not learning vectors at school.[/I]
I really need help again with trigonometry
[t]http://i.imgur.com/t3ul6FW.png[/t]
I'm trying to make it so that it forces a player to move to the target position, but I can only tell it to go forward or right relative to the yaw of the player as in
Forward = 0.32 , Right = -1 (this makes it go slightly forward but all the way to the left)
I have this so far but I'm stuck with the whole world/local buisness
[lua] local BotAng = Angle(0,bot:EyeAngles().y,0)
local BotPos = bot:GetPos()
local NewVector, NewAngle = WorldToLocal(targetpos,Angle(0,0,0),BotPos,BotAng)
[/lua]
not sure if I'm doing it right, though
[QUOTE=_FR_Starfox64;47062755]How, from an initial vector let's say [I]pos1[/I] I would calculate [I]pos2[/I], a vector that needs to be 50 units away from [I]pos1[/I] with an angle of Angle(0, 45, 0).
[I]No need to remind me how dumb I am for not learning vectors at school.[/I][/QUOTE]
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Vector/Distance]Vector:Distance[/url]
[QUOTE=StonedPenguin;47062829][img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Vector/Distance]Vector:Distance[/url][/QUOTE]
I'm not looking for the distance bet pretty much the position of a position + angle + distance like If I go 50 units at Angle(0, 45, 0) where do I end up?
I'm trying to move particles between 2 control points but just realized that this method below is outdated.
[LUA] local CPoint0 = {
["entity"] = self.Colossus_Cannon,
["attachtype"] = PATTACH_ABSORIGIN_FOLLOW,
}
local CPoint1 = {
["entity"] = self,
["attachtype"] = PATTACH_ABSORIGIN_FOLLOW,
}
--Create the particle effect!
self:CreateParticleEffect("colossus_tracer",{CPoint0,CPoint1})
[/LUA]
Does anyone know the way of assigning control points so that particles can move from 1 control point to another? This is for non-lua particle effects.
[QUOTE=ROFLBURGER;47062822]I really need help again with trigonometry
[t]http://i.imgur.com/t3ul6FW.png[/t]
I'm trying to make it so that it forces a player to move to the target position, but I can only tell it to go forward or right relative to the yaw of the player as in
Forward = 0.32 , Right = -1 (this makes it go slightly forward but all the way to the left)
I have this so far but I'm stuck with the whole world/local buisness
[lua] local BotAng = Angle(0,bot:EyeAngles().y,0)
local BotPos = bot:GetPos()
local NewVector, NewAngle = WorldToLocal(targetpos,Angle(0,0,0),BotPos,BotAng)
[/lua]
not sure if I'm doing it right, though[/QUOTE]
( PlayerPos - TargetPos ):GetNormalized() and ( PlayerPos - TargetPos ):Angle():Right()
[QUOTE=_FR_Starfox64;47062857]I'm not looking for the distance bet pretty much the position of a position + angle + distance like If I go 50 units at Angle(0, 45, 0) where do I end up?[/QUOTE]
this is what unit vectors are for
[lua]
pos + angle:Forward()*distance
[/lua]
[QUOTE=GGG KILLER;47062691]I've used those functions you gave me, but when I used the test_arc concommand, it just made me start lagging after some time and nothing showed up on my screen...[/QUOTE]
Here's an example to draw a health bar:
[lua]
hook.Add("HUDPaint","Draw Arc Healthbar",function()
local x,y = 200,200
local radius = 100
local thickness = 20
local startAng,endAng = 1, ( LocalPlayer():Health() / 100 ) * 359
draw.Arc(x,y,radius,thickness,startAng,endAng,1,Color(255,0,0))
end)
[/lua]
[B]Hey everyone, is there some kind of practical limit on the size of a LUA file?[/B]
I'm building a gamemode. Until recently I had all my autorun in three files (client, server and shared), each of which were maybe 2000 lines (~80kb).
Until this point, I've greatly enjoyed the lua autorefresh feature of GMod13, I just make changes to the code and ta-da they're instantly in game. But then things started crashing. I have very few addons enabled (dev mode, I want fast load times), and the game is otherwise very stable, but whenever I make a change to a script file, gmod crashes instantly. It's like it crashes while trying to reload the file.
I broke my autorun out into six files, halving each in size, but it still crashes whenever I try to make changes at runtime. Is it because the files are too big? Has anyone encountered this?
[QUOTE=ThrowAwayAcct;47063623][B]Hey everyone, is there some kind of practical limit on the size of a LUA file?[/B]
I'm building a gamemode. Until recently I had all my autorun in three files (client, server and shared), each of which were maybe 2000 lines (~80kb).
Until this point, I've greatly enjoyed the lua autorefresh feature of GMod13, I just make changes to the code and ta-da they're instantly in game. But then things started crashing. I have very few addons enabled (dev mode, I want fast load times), and the game is otherwise very stable, but whenever I make a change to a script file, gmod crashes instantly. It's like it crashes while trying to reload the file.
I broke my autorun out into six files, halving each in size, but it still crashes whenever I try to make changes at runtime. Is it because the files are too big? Has anyone encountered this?[/QUOTE]
Slightly under 64KB for Lua files sent to the client.
[QUOTE=Willox;47063627]Slightly under 64KB for Lua files sent to the client.[/QUOTE]
That helps, I have a couple that hit that limit... I'll break them out.
What about data structures? Is there a limit on how large a LUA Table should be? I have a single large completely static table that exists client/server, into which I put all my addon's functions and data, for the sake of not cluttering the global namespace. I'd wager that it's pretty big. As I understand, this is standard practice though, right?
EDIT:
And for the size limit on files, does that include "include" directives? Does "includ"ing another file effectively raise this file's size?
[QUOTE=ThrowAwayAcct;47063687]That helps, I have a couple that hit that limit... I'll break them out.
What about data structures? Is there a limit on how large a LUA Table should be? I have a single large completely static table that exists client/server, into which I put all my addon's functions and data, for the sake of not cluttering the global namespace. I'd wager that it's pretty big. As I understand, this is standard practice though, right?
EDIT:
And for the size limit on files, does that include "include" directives? Does "includ"ing another file effectively raise this file's size?[/QUOTE]
Include won't increase a file's size (except for the code that actually calls include).
Sorry, you need to Log In to post a reply to this thread.