Jump to content
  • 0

request npc mvp rank rewarding


Question

Posted

Hi, nice to meet you
how can i make the npc ranking give prizes to the first place

Quote

 

prontera,164,174,3    script    MvP Rank Kamael    660,{
query_sql( "DELETE FROM `mvp_ranking` WHERE `name` NOT IN ( SELECT `name` FROM `char` )" );
query_sql( "select name, points from mvp_ranking where points > 0 order by points desc limit "+ .top, .@name$, .@points );

set .@size, query_sql( "select name, points from mvp_ranking where points > 0 order by points desc limit "+ .top, .@name$, .@points );

    mes "[^FF0000MvP ^0000FFRank ^00FF00 ^FF0000" + .top +"^000000]";
    for (set .@c, 0; .@c < .@size; set .@c, .@c + 1)
        mes "Lider ^FF0000" +(.@c + 1) +"^000000 ^0000FF" + .@name$[.@c] +"^000000 con ^FF0000" + .@points[.@c] +"^000000 MvP.";
        mes "* ^ff0000 RANK SE RESETEA LOS DOMINGOS ^000000 *";
    close;

OnInit: // Script Configuration

// lsitado mvp
setarray $mobmvpA[0],1046,1059,1086,1112,1115,1147,1150,1159,1885,1980,1389,1038,1039,1087,1157,1190,1251,1252,1272,1312,1373,1399,1418,1492,1511,1583,1630,1658,1785,1623,1685,1688,1708,1719,1734,1751,1768,1832,1871,1874,1917,2022,16461647,1648,1649,1650,1651; 
    set .a, 1; // Broadcast who killed the MvP and wich MvP and wick Map [0 Off - 1 On]
    set .top, 10; // Max. Top Rank (Hihgly recommended between 5~10, more maybe bug the server (limited variables)
    end;

OnNPCKillEvent: // Script execution

    for (set .@i, 0; .@i < getarraysize($mobmvpA); set .@i, .@i + 1) {
        if(killedrid == $mobmvpA[.@i]) {

    if (.a) // If announce On
        announce "[ Moodplay Anuncia ]: [ " +getmonsterinfo(killedrid,0) +" ]  ha sido destrozado por [ " +strcharinfo(0) +" ]",bc_blue|bc_all;
    query_sql "insert into `mvp_ranking` value ( "+ getcharid(0) +", '"+ escape_sql( strcharinfo(0) ) +"', 1 ) on duplicate key update `points` = if ( `points` + 1 > 200, 0, `points` + 1 )";
    end;
    
    }
    }

}

 

 

3 answers to this question

Recommended Posts

  • 0
Posted

error 
for ( .@i = 0; .@i < .@nb; ++.@i )


line 60
    script:add_word: invalid word. A word consists of undercores and/or alphanum                                                                                                                                                eric characters, and valid variable prefixes/postfixes.
    55 :                .@nb = query_sql(.@query$, .@name$, .@rank, .@kills, .@d                                                                                                                                                ummy);
    56 :                if ( !.@nb ) {
    57 :                        mes "  No entry.";
    58 :                        close;
    59 :                }
*   60 :                for ( .@i = 0; .@i < .@nb; '+'+.@i )
    61 :                        mes .@rank[.@i] +". "+ .@name$[.@i] +" -> "+ .@k                                                                                                                                                ills[.@i] +" points";
    62 :                close;
    63 :        case 2:
    64 :                if ( !query_sql( "SELECT `mvp_kills`, 1+(SELECT COUNT(1)                                                                                                                                                 FROM `mvp_rank` t1 WHERE t1.`mvp_kills` > t2.`mvp_kills`) FROM `mvp_rank` t2 WH                                                                                                                                                ERE `char_id` = "+ getcharid(0), .@kills, .@rank ) ) {
    65 :                        mes "You haven't kill MVP this week";
 

 

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