Jump to content
  • 0

PvP Ladder keeps resetting.


Helena

Question


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   1
  • Joined:  08/10/13
  • Last Seen:  

Hello rAthena,

 

Could anyone help me here? I'm using I believe Annie's PvP ladder, but the kills and deaths are going so weird...

When I log back in after a night of sleeping, someone that previously had 0 kills and 6 deaths, suddenly has 2 kills and 2 deaths.

 

Another thing is sometime when a player crashes all his pvp stats reset. :/

 

 

I really just want it to function properly... if that's impossible could someone direct me to another simple pvp ladder similar to this one? Thanks!

 

Here is the script. Help is very much appreciated! :)

 

-    script    job_pvp    -1,{
OnInit:
    // only 1 config lol
    set .gmnokill, 0; // GMs are not suppose to kill players. A GM with <this number> level or higher will do nothing. IF set to 60, GM60 and above kill any player will not get anything : 0 - off
 
    if ( .gmnokill <= 0 ) set .gmnokill, 101; // prevent bug
    end;
OnPCKillEvent:
if ( @pvpl_deaths ) end;
//else if ( getgmlevel() >= .gmnokill ) end;
    set @pvpl_deaths, @pvpl_deaths +1;
    query_sql "replace delayed into pvpladder values ( "+ getcharid(0) +", '"+ escape_sql(strcharinfo(0)) +"', "+ @pvpl_kills +", "+ @pvpl_deaths +", "+ class +" )";
    if ( killerrid == getcharid(3) ) end; // kill himself(like grandcross) doesn't add kills count
    donpcevent "PvP Ranker::OnInit";
    end;
 
OnPCDieEvent:
if ( @pvpl_kills ) end;
    set @pvpl_kills, @pvpl_kills +1;
    query_sql "replace delayed into pvpladder values ( "+ getcharid(0) +", '"+ escape_sql(strcharinfo(0)) +"', "+ @pvpl_kills +", "+ @pvpl_deaths +", "+ class +" )";
    donpcevent "PvP Ranker::OnInit";
    end;
 
OnPCLoadMapEvent:
    if ( @pvpl_kills || @pvpl_deaths ) end;
    query_sql "select kills, deaths from pvpladder where char_id = "+ getcharid(0), @pvpl_kills, @pvpl_deaths;
    end;
}
 
prontera,146,174,6    script    PvP Ranker    733,{
    while(1) {
        mes "[PvP Ranker]";
        mes "Hi, "+ strcharinfo(0);
        mes "What can I do for you?";
        next;
        menu "Display the PvP Ladder",-;
        set .@nb, query_sql("select name, kills, deaths, class from pvpladder order by kills"+( (@menu == 2)?"/deaths":" desc" )+" limit 10", .@name$, .@kills, .@deaths, .@class );
            mes "[^006699Name^000000] - [^00AA00Kills^000000] - [^FF0000Deaths^000000]";
            for ( set .@i, 0; .@i < .@nb; set .@i, .@i +1 )
            mes "^996600"+ (.@i+1) +")^000000 [^006699"+ .@name$[.@i] +"^000000] - [^00AA00"+ .@kills[.@i] +"^000000] - [^FF0000"+ .@deaths[.@i] +"^000000]";
            close;
            if ( .@nb == 0 )
                mes "The PvP Ladder is empty";
                close;
}
end; 
 
OnInit:
    delwaitingroom strnpcinfo(1);
    set .@nb, query_sql("select name, kills from pvpladder order by kills desc limit 1", .@name$, .@kills );
    waitingroom "#1 Player: "+ .@name$ +" ("+ .@kills +" kills)",0;
    end;
}
Edited by Helena
Link to comment
Share on other sites

1 answer to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   1
  • Joined:  08/10/13
  • Last Seen:  

No one? :(

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...