• What do you need help with? V3
    6,419 replies, posted
Does anyone have a good Mesh library tutorial?
[QUOTE=wizardsbane;38600391][URL]https://developer.valvesoftware.com/wiki/RCON[/URL] [editline]lolno[/editline] P.S. Please don't use PHP unless you really, really have to.[/QUOTE] I'm only using it once, not for some kind of fancy admin control panel or anything. When a player donates I need to have it run a script to check if they are in game. Because currently if they are in game and donate, it fails. Considering it only updates the database which gets overwritten by the players next save or if they disconnect. And I figure this is better than saving donation status and checking it every time before players save. [editline]26th November 2012[/editline] [QUOTE=Drakehawke;38598604]?? [url]http://glua.me/bin/?path=/lua/vgui/dimage.lua#93[/url] [lua] local mat = Material( "path/to/material" ) function mydimage:DoClick() self:SetMaterial( mat ) -- or self:SetImage( "path/to/vmt.vmt" ) end[/lua][/QUOTE] He said change an image on a panel when a button is pressed. So I assumed he meant change an actual image and not the button image, kind of overlooked the dimage part.
What would be a limit on umsg send calls from the server?
[QUOTE=CrashLemon;38603392]What would be a limit on umsg send calls from the server?[/QUOTE] The size, 255 bytes. It is better to use the net. library it is a little faster and does not have a byte limit. [URL]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index5b6a.html[/URL] Yea net. has a limit, although you will most likely never hit it. 65kb
[QUOTE=find me;38603667]The size, 255 bytes. It is better to use the net. library it is a little faster and does not have a byte limit. [url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index5b6a.html[/url][/QUOTE] Doesn't it have a 65kb limit?
[QUOTE=Darkwater124;38603895]Doesn't it have a 65kb limit?[/QUOTE] Yea my bad, although the chances of ever hitting that limit are slim.
[QUOTE=itkuitkzhji;38593723]I want to run a timer (clientside) when the connection between a player and server is interrupted. Any idea? Everything else will run, except for the timer. Should I try some while loop function to make my own timer? xD [CODE]MsgN("Can you please start a timer for me?") timer.Simple(1, function() MsgN("Hi!") end) MsgN("Yeah, just ignore my timer like you always do! -_-")[/CODE] Output: "Can you please start a timer for me?" "Yeah, just ignore my timer like you always do! -_-" Edit: Alright. I tried to have my own timer but it kills Gmod. ^^ x = RealTime() + 3 while(x > RealTime()) do end[/QUOTE] while loops crash 95% of the time. try using this: [CODE] x = RealTime() + 3 function derp() if x > RealTime() then --print or do shit here end end timer.Create("checkshit", 1, 0, derp ) [/CODE] it'll do what you're trying to do.
[QUOTE=cabbiethefirst;38603947]while loops crash 95% of the time. try using this: [CODE] x = RealTime() + 3 function derp() if x > RealTime() then --print or do shit here end end timer.Create("checkshit", 1, 0, derp ) [/CODE] it'll do what you're trying to do.[/QUOTE] As I said, timers won't work. But you brought me another idea. The think hook does still work, even if the connection between player and server is interrupted. So I'll just make a timer which keeps the X variable on a certain value. As soon the connection is interrupted, the RealTime() function will return after 2-3 seconds a hogher value than X. So this will be my "timer" somehow like this: [CODE]function KeepXHigh() x = RealTime() + 3 // Make sure x is always bigger than RealTime() as long everything is fine WaitOneSecond = false end hook.Add("Think" , "ConnectionInterrupted" , function() if not WaitOneSecond then timer.Simple(1, function() KeepXHigh() end) WaitOneSecond = true if x < RealTime() then // If the connection breaks, the X value will get lower than RealTime(). // my code when the connection is interrupted for more than 3 seconds end end end )[/CODE] Now rate me luaking or give me a better idea please. ^^
How can I get rid of this warning? "ConVarRef CONVARNAME doesn't point to an existing ConVar" It only pops up on client when joining a server. The convars are shared and they are created like this. [lua] CreateConVar("SomeVarName", SomeValue, { FCVAR_REPLICATED, FCVAR_ARCHIVE }) [/lua] I'm sure there is a simple solution for this, just haven't found any. Am I using the wrong flags?
jk. [lua] local q = tmysql.query( "INSERT INTO table VALUES ('"..Name.."')", function( tbl, status, err ) FloodBans = table.Copy( tbl ) end ) tmysql.escape( q ) [/lua] That's how you use escape properly right?
no. try something like [lua] local Name = tmysql.escape(Name); tmysql.query( "INSERT INTO table VALUES ('"..Name.."')", function( tbl, status, err ) FloodBans = table.Copy( tbl ) end ) [/lua]
[QUOTE=G4MB!T;38606283]no. try something like [lua] local Name = tmysql.escape(Name); tmysql.query( "INSERT INTO table VALUES ('"..Name.."')", function( tbl, status, err ) FloodBans = table.Copy( tbl ) end ) [/lua][/QUOTE] I think the usage is different with tmysql3? [lua] local X = tmysql.escape( "Test" ) print(X) [/lua] [code] nil [/code]
are you connected to the mysql server when you run that
[QUOTE=Banana Lord.;38606762]are you connected to the mysql server when you run that[/QUOTE] Oh weird, thanks. I figured because it was returning a string it wouldn't need to be connected.
I'm having trouble with this "pimpmyride" module getting included correctly. The image I linked here will give you all the information you need to help me debug this info and if it doesn't, just ask and I'll provide that info. Thanks for any help. [url]http://u.filepak.com/0YRG_error.png[/url]
Hi, I was trying to fix the old AntiCrash script by FlapJack (Found [URL="http://facepunch.com/showthread.php?t=989733"]here[/URL]). I have done everything in the "Why your scripts are now broken" list to fix it, and now there are no errors, but instead, it just doesn't work. What it is supposed to do is send the ping and if it doesn't receive a response, the GUI pops up and it will also auto-reconnect based on your cl_timeout value. Now, it simple doesn't pop up, and the only thing that comes up in console is "[AntiCrash] Disconnected - Sending Ping". If anybody could help me with this it would be greatly appreciated, thanks a ton! [URL="http://pastebin.com/rChyjd5f"]Link to the (broken) script with the edits that I made so far[/URL]
[QUOTE=mdew355;38606988]I'm having trouble with this "pimpmyride" module getting included correctly. The image I linked here will give you all the information you need to help me debug this info and if it doesn't, just ask and I'll provide that info. Thanks for any help. [url]http://u.filepak.com/0YRG_error.png[/url][/QUOTE] holy shit is your font for notepad++ big enough?
[QUOTE=G4MB!T;38607199]holy shit is your font for notepad++ big enough?[/QUOTE] Holy shit, it's just for the image! :D I'm not blind.
[QUOTE=Drakehawke;38598604]?? [url]http://glua.me/bin/?path=/lua/vgui/dimage.lua#93[/url] [lua] local mat = Material( "path/to/material" ) function mydimage:DoClick() self:SetMaterial( mat ) -- or self:SetImage( "path/to/vmt.vmt" ) end[/lua][/QUOTE] do either of these work on PNG images?
[QUOTE=Archemyde;38609862]do either of these work on PNG images?[/QUOTE] Yup, you just need to add an extra argument to Material; a string of one of the following: vertexlitgeneric unlitgeneric nocull alphatest mips noclamp smooth (see [url]http://wiki.garrysmod.com/page/Global/Material[/url] )
[QUOTE=jmazouri;38610081]Yup, you just need to add an extra argument to Material; a string of one of the following: vertexlitgeneric unlitgeneric nocull alphatest mips noclamp smooth (see [url]http://wiki.garrysmod.com/page/Global/Material[/url] )[/QUOTE] The second argument is completely optional, all you need to do is include the .png extension and it should work [editline]27th November 2012[/editline] [QUOTE=mdew355;38606988]I'm having trouble with this "pimpmyride" module getting included correctly. The image I linked here will give you all the information you need to help me debug this info and if it doesn't, just ask and I'll provide that info. Thanks for any help. [url]http://u.filepak.com/0YRG_error.png[/url][/QUOTE] Are you using the GMod 13 version?
Is there any way to put PHP variables into LUA? (By using $_GET and eventually some clientsided.) I know how to open a window etc but its just the variables from a php file i would need.
Im starting to learn GLua, but im very very confused and the documentation Isen't really helping me out. [CODE]if ( player:Team() == 1 ) then end hook.Add( "PlayerSpawn", "MyMessageFunction", function( player ) player:PrintMessage( HUD_PRINTCENTER, "You Respawned. fuck you and shit" ) end )[/CODE] I don`t know why but its always saying "RunString:3: attempt to call method 'Team' (a nil value)" What am I doing wrong? How can I find out what team the player is on and use it? i don`t understand. Do I have to set the Team first? How do I set it. I m so confused :/
[QUOTE=nexitem;38611726]Im starting to learn GLua, but im very very confused and the documentation Isen't really helping me out. [CODE]if ( player:Team() == 1 ) then end hook.Add( "PlayerSpawn", "MyMessageFunction", function( player ) player:PrintMessage( HUD_PRINTCENTER, "You Respawned. fuck you and shit" ) end )[/CODE] I don`t know why but its always saying "RunString:3: attempt to call method 'Team' (a nil value)" What am I doing wrong? How can I find out what team the player is on and use it? i don`t understand. Do I have to set the Team first? How do I set it. I m so confused :/[/QUOTE] The error is telling you that nil.Team is a nil value (doesn't exist). This is because you have a variable named player just hanging out in the open undefined and not enclosed in any function. That if clause is also empty so it does entirely nothing. If you remove that useless if your code should stop erroring.
-snip, stupid encoding errors-
Is it possible to create an image from a model and save it? I realize this is done in materials/spawnicons but what if I want a custom size?
[QUOTE=nexitem;38611726]Im starting to learn GLua, but im very very confused and the documentation Isen't really helping me out. [lua]if ( player:Team() == 1 ) then end hook.Add( "PlayerSpawn", "MyMessageFunction", function( player ) player:PrintMessage( HUD_PRINTCENTER, "You Respawned. fuck you and shit" ) end )[/lua] I don`t know why but its always saying "RunString:3: attempt to call method 'Team' (a nil value)" What am I doing wrong? How can I find out what team the player is on and use it? i don`t understand. Do I have to set the Team first? How do I set it. I m so confused :/[/QUOTE] Don't use 'player' as a variable/parameter name. It conflicts with the player library. That error means you're trying to call a method on 'player' that doesn't exist. Inside that function, 'player' is a parameter that should be a player object; outside, 'player' is the player library. [lua]-- always always localize functions, it's significantly faster local function insultPlayerOnRespawn(ply) -- note that players will start on TEAM_UNASSIGNED, so you'll have to set it yourself one way or another if ply:Team() == 1 then ply:PrintMessage(HUD_PRINTCENTER, "You respawned. Fuck you.") end end hook.Add("PlayerSpawn", "InsultPlayerOnRespawn", insultPlayerOnRespawn) [/lua]
Tip: Use pl or ply instead [editline]27th November 2012[/editline] Most people use those
How do you remove an effectdata? [lua]effectdata:Remove()[/lua] ^ Returns an error.
Is there a way to easily port old entities into the new Gmod13 engine?
Sorry, you need to Log In to post a reply to this thread.