Jump to content
  • 0

Error in KDR Function.


Legato

Question


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  87
  • Reputation:   1
  • Joined:  11/20/11
  • Last Seen:  

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.

Link to comment
Share on other sites

14 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

perhap it is some npc script you have added before??

maybe some function named KDR ??

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  317
  • Reputation:   63
  • Joined:  11/13/11
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  87
  • Reputation:   1
  • Joined:  11/20/11
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  562
  • Reputation:   152
  • Joined:  02/21/12
  • Last Seen:  

Please post script here or @www.pastebin.com

We can't help just with guessing.

Edited by tr0n
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  87
  • Reputation:   1
  • Joined:  11/20/11
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  46
  • Topics Per Day:  0.01
  • Content Count:  292
  • Reputation:   17
  • Joined:  12/12/11
  • Last Seen:  

It's just a normal message.. :)

It will not cause harm.. It's just saying that it cannot calculate anything because the player haven't died yet..

NO Death = Debugmes

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  562
  • Reputation:   152
  • Joined:  02/21/12
  • Last Seen:  

@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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  87
  • Reputation:   1
  • Joined:  11/20/11
  • Last Seen:  

I did not change anything on the script.

That debug mes only appears when I adjust the level of a GM. From level 99 to 0 and then log out.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  562
  • Reputation:   152
  • Joined:  02/21/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  87
  • Reputation:   1
  • Joined:  11/20/11
  • Last Seen:  

So, do I need to be worried about it and do you know how to fix it?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  562
  • Reputation:   152
  • Joined:  02/21/12
  • Last Seen:  

[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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  43
  • Reputation:   2
  • Joined:  01/17/12
  • Last Seen:  

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.

Link to comment

  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  633
  • Reputation:   78
  • Joined:  11/14/11
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  43
  • Reputation:   2
  • Joined:  01/17/12
  • Last Seen:  

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
Link to comment
Share on other sites

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.

×
×
  • Create New...