Jump to content
  • 0

Help i want to put a reset choose for gm


itsmeyoe

Question


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  54
  • Reputation:   1
  • Joined:  05/19/12
  • Last Seen:  

prontera,131,207,5    script    WoE Rank#PvP    421,{
    mes "[ ^FF0000Top 10 WoE Killers^000000 ]";
    if ( .@size  = getarraysize( $topwoe1pvp_name$ ) ) {
        for ( .@i = 0; .@i < .@size; .@i++ )
            mes ""+( .@i +1 )+": ^0000FF"+ $topwoe1pvp_name$[.@i] +"^000000 - ^FF0000"+ $topwoe1pvp_points[.@i] +"^000000 Kill.";
    }
    else
        mes "<empty>";
    close;
OnPCKillEvent:
    if ( !getmapflag( strcharinfo(3), mf_gvg_castle ) ) end;
    topwoe1pvp_points++;
    .@i = 0;
    while ( .@i < .ladderlength ) {
        if ( topwoe1pvp_points > $topwoe1pvp_points[.@i] ) { // if found
            if ( $topwoe1pvp_name$[.@i] == strcharinfo(0) ) { // update your own points
                $topwoe1pvp_points[.@i] = topwoe1pvp_points;
                break;
            }
            else if ( .@i == .ladderlength - 1 ) { // last position of the ladder, just overwrite the value
                $topwoe1pvp_points[.@i] = topwoe1pvp_points;
                $topwoe1pvp_name$[.@i] = strcharinfo(0);
                break;
            }
            // if more points, but somehow its not your own name
            .@j = .@i +1 ; // save the index
            while ( $topwoe1pvp_name$[.@j] != strcharinfo(0) && .@j < .ladderlength ) .@j++;
            if ( .@j < .ladderlength ) // found your name
                .@moveamount = .@j - .@i; // save amount to move
            else // if not found ...
                .@moveamount = .ladderlength - 1 - .@i; // means move the whole ladder from the last index
            copyarray $topwoe1pvp_points[.@i +1], $topwoe1pvp_points[.@i], .@moveamount;
            copyarray $topwoe1pvp_name$[.@i +1], $topwoe1pvp_name$[.@i], .@moveamount;
            $topwoe1pvp_points[.@i] = topwoe1pvp_points;
            $topwoe1pvp_name$[.@i] = strcharinfo(0);
            break;
        }
        .@i++;
    }
    end;
OnInit:
    .ladderlength = 10;
    end;
}

 

Edited by Emistry
Please use CODEBOX.
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

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

Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

For an example of a reset look at my pvp ladder about line 162~

 

https://github.com/Stolao/Npc_Release/blob/master/PvP_Ladder/Pvp_Ladder.txt

Then just add an OnHour00: Label which you can learn about https://github.com/Stolao/rathena/blob/master/doc/script_commands.txt

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  54
  • Reputation:   1
  • Joined:  05/19/12
  • Last Seen:  

@Emistry i use the script u gave the problem now is like this one.

screenCannabis069.jpg

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