Ulysses

General => Developers Corner => Topic started by: pikkip on March 30, 2013, 01:25:34 PM

Title: Trying to fix GetInfoNum in my plugin
Post by: pikkip on March 30, 2013, 01:25:34 PM
Hello people!
So here's the deal, I've been trying to fix a few old plugins this day, and I got stuck on this error right now.
Code: [Select]
lua/autorun/server/sv_physgun.lua:20: bad argument #2 to 'GetInfoNum' (number expected, got no value)The 20th line in the lua looks like this:
Code: [Select]
if ply:GetInfoNum( pb_.. "enabled" ) ~= 0 thenand ofc. the pb_ is something else (BEFORE the code above)
Code: [Select]
local pb_ = "physgun_buildmode_"
ANY idea why it calls errors? I don't see any form for additional agument on the line...
Title: Re: Trying to fix GetInfoNum in my plugin
Post by: pikkip on March 30, 2013, 02:02:03 PM
Well, bloody darn, It turned out that it needed another argument after i read the line again... sorry 'bout that fokes!
Title: Re: Trying to fix GetInfoNum in my plugin
Post by: Megiddo on March 30, 2013, 02:28:01 PM
That rubber duck (http://www.codinghorror.com/blog/2012/03/rubber-duck-problem-solving.html) sure is mystical, no?
Title: Re: Trying to fix GetInfoNum in my plugin
Post by: JamminR on March 30, 2013, 04:25:24 PM
Wow. I love that page.
They had me at: (emphasis mine)
Quote
we insist that people who ask questions put some effort into their question, and we're kind of jerks about it

EDIT - I just read the entire page.
And realized...I make an awesome duck, and am proud of that fact.
I may not always know the exact <insert code construct/tech construct/whatever geek question> from scratch...but I'm tech-geek enough to give ideas back to those who ask me questions.
Everyone needs a duck for a friend.