Jump to content
  • 0

Error in KDR Function.


Question

Posted

First off, I did not get this message from rAthena's SVN. But, I figured I'd post it here anyway because, lots of people are active in this forum. Here's a screen shot of the said error

34h9h86.png

Happens when I use the @adjgmlvl 0 <player's name> command on a GM character and then log off.

Tia.

14 answers to this question

Recommended Posts

Posted

if(!getarg(1)) { debugmes "Error in KDR function, getarg(1) invalid value"; return 0; } // [Lighta]

Caused by this script - Link

As you can see, it's just a debug message.

And you are getting it because that said character has NEVER died yet.

Or at least the NPC never recorded any death from him yet. Thus, KDR (Kill Death Ratio) is impossible to calculate.

  • Upvote 1
Posted (edited)

Ohh, right. It's happened after I installed that script.(Didn't read the script codes,though. :D)

Thanks, Conflicts and Emistry. :)

EDIT :

So, does anyone have any idea why it only happens when I adjust the gm level and then log out?

Edited by Legato
Posted

Please post script here or @www.pastebin.com

We can't help just with guessing.

Conflicts already posted a link of the script.

You should've seen it if you were reading other's posts.

And I did not know that debug mes was caused by that script in the first place that's why I had provided a screen shot of the error.

Posted (edited)

@Legato

My fault, I didn't see the link.

On or Off ?

OnInit:
//--Configuration
set .System, 1; //Toggle PvP System (0:Disable|1:Enable)

and which value do you use here ?

set .GMLevel, 90; //GM levels above or equal this level will be ignored by the system

Edited by tr0n
Posted (edited)

It does a callfunc with variables in a query_sql @OnPCLogoutEvent.

Gms above 90 doen't get any variables set for this: (Kill, Death)

callfunc("KDR_Calc", Kill, Death)

Now after you set your gm lvl to 0 this will happen @OnPCLogoutEvent:

if(!getarg(1)) { debugmes "Error in KDR function, getarg(1) invalid value"; return 0; } // [Lighta]

Correct me If I'm wrong.

Edited by tr0n
Posted (edited)

[don't worry], it prevents that 0 gets calculated.(be happy~)

If you don't want this debugmes change this:

if(!getarg(1)) { debugmes "Error in KDR function, getarg(1) invalid value"; return 0; } // [Lighta]

into this:

if(!getarg(1)) return 0; // [Lighta]

Edited by tr0n
Posted · Hidden by Derceto, March 13, 2012 - already posted above
Hidden by Derceto, March 13, 2012 - already posted above

imho debugmes is pointless there, return 0 (or -1) would be sufficient as "0" deaths isn't that uncommon.

Posted

i think that happens when you have 0 deaths because if you have zero death it will lead to a undefined result example: 14 kills / 0 deaths = undefined. I think if you have 0 deaths you should have a 14.0 ratio. My guess is to make +1 to deaths so it would be 14 kills / 0+1 deaths = 14.0 ratio

Posted (edited)

i think that happens when you have 0 deaths because if you have zero death it will lead to a undefined result example: 14 kills / 0 deaths = undefined. I think if you have 0 deaths you should have a 14.0 ratio. My guess is to make +1 to deaths so it would be 14 kills / 0+1 deaths = 14.0 ratio

[don't worry], it prevents that 0 gets calculated.(be happy~)

If you don't want this debugmes change this:

if(!getarg(1)) { debugmes "Error in KDR function, getarg(1) invalid value"; return 0; } // [Lighta]

into this:

if(!getarg(1)) return 0; // [Lighta]

if(!getarg(1)) { return getarg(0); }

It's the naming that was wrong here, "Error" is a too disturbing thing to write in debug. Should have been "Info:" or something, If there's any need for it at all, that is.

Edited by Derceto

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...