Jump to content

Question

Posted

Hi good day any one can help me. there's no error on the script but i think the ranking is not working please help me with the ranking thank you..

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
      * ~~~~~~~~  Euphy's MVP Ladder v1.3  ~~~~~~~~ *
      * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
 
prontera,148,170,6	script	MVP Ladder	891,{
mes "[Rank MVP]";
mes "Hello.";
mes "What are you doing here";
next;
switch(select("Check Ranking.:My points.:Nothing...")) {
case 1:
mes "[Rank MVP]";
query_sql("SELECT char_id,CAST(`value` AS SIGNED) FROM `global_reg_value` WHERE `str` = 'MVP_Rank' ORDER BY CAST(`value` AS SIGNED) DESC LIMIT 20",.@cid,.@value);
for(set .@i,0; .@i<getarraysize(.@cid); set .@i,.@i+1) {
query_sql("SELECT `name` FROM `char` WHERE char_id = "+.@cid[.@i]+";",.@j$);
set .@name$[.@i], .@j$;
}
if (!getarraysize(.@cid))
mes "The rankings are empty.";
else for(set .@i,0; .@i<getarraysize(.@cid); set .@i,.@i+1)
mes "["+(.@i+1)+"] "+.@name$[.@i]+" ~ "+.@value[.@i]+" kills";
close;
case 2:
mes "[Rank MVP]";
mes "You killed "+((MVP_Rank)?"^0055FF"+MVP_Rank:"no")+"^000000 MVP"+((MVP_Rank == 1)?".":"s.");
close;
case 3:
close;
}
 
OnNPCKillEvent:
if (getmonsterinfo(killedrid,22)) {
set MVP_Rank, MVP_Rank+1;
if (MVP_Rank == 1)
query_sql("INSERT INTO `global_reg_value` (`char_id`,`str`,`value`,`type`,`account_id`) VALUES ("+getcharid(0)+",'MVP_Rank','1',3,0)");
else
query_sql("UPDATE `global_reg_value` SET `value` = '"+MVP_Rank+"' WHERE char_id = "+getcharid(0)+" AND `str` ='MVP_Rank'");
dispbottom "~ You killed "+MVP_Rank+" MVP"+((MVP_Rank == 1)?"":"s")+". ~";
dispbottom " ~ Reward: Cash +15 ~ ";
set #CASHPOINTS, #CASHPOINTS + 15;
specialeffect2 313;
}
end;
}

9 answers to this question

Recommended Posts

Posted

I updated the mechanics of the Script you posted, try it:

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
      * ~~~~~~~~  Euphy's MVP Ladder v1.3  ~~~~~~~~ *
      * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
 
prontera,148,170,6	script	MVP Ladder	891,{
	mes "[Rank MVP]";
	mes "Hello.";
	mes "What are you doing here";
	next;
	switch(select("Check Ranking.:My points.:Nothing...")) {
		case 1:
			mes "[Rank MVP]";
			query_sql("SELECT char_id, CAST(`value` AS SIGNED) FROM `char_reg_num` WHERE `key` = 'MVP_Rank' ORDER BY CAST(`value` AS SIGNED) DESC LIMIT 20",.@cid,.@value);
			for(set .@i,0; .@i<getarraysize(.@cid); set .@i,.@i+1) {
				query_sql("SELECT `name` FROM `char` WHERE char_id = "+.@cid[.@i]+";",.@j$);
				set .@name$[.@i], .@j$;
			}
			if (!getarraysize(.@cid))
				mes "The rankings are empty.";
			else for(set .@i,0; .@i<getarraysize(.@cid); set .@i,.@i+1)
			mes "["+(.@i+1)+"] "+.@name$[.@i]+" ~ "+.@value[.@i]+" kills";
			close;
			
		case 2:
			mes "[Rank MVP]";
			mes "You killed "+((MVP_Rank)?"^0055FF"+MVP_Rank:"no")+"^000000 MVP"+((MVP_Rank == 1)?".":"s.");
			close;
			case 3:
			close;
	}
 
OnNPCKillEvent:
	if (getmonsterinfo(killedrid,22)) {
		set MVP_Rank, MVP_Rank+1;
	if (MVP_Rank == 1)
		query_sql("INSERT INTO `char_reg_num` (`char_id`,`key`,`index`,`value`) VALUES ("+getcharid(0)+",'MVP_Rank','0',1)");
	else
		query_sql("UPDATE `char_reg_num` SET `value` = '"+MVP_Rank+"' WHERE char_id = "+getcharid(0)+" AND `key` ='MVP_Rank'");
		dispbottom "~ You killed "+MVP_Rank+" MVP"+((MVP_Rank == 1)?"":"s")+". ~";
		dispbottom " ~ Reward: Cash +15 ~ ";
		set #CASHPOINTS, #CASHPOINTS + 15;
		specialeffect2 313;
	}
	end;
}

Let me know if there is any errors.

  • 0
Posted

 

On 11/1/2015 at 10:21 AM, Haziel said:

Glad it worked.

I'm here to help, don't mention it.

Thank you so much it work well for me, but is there any option to reset the MVP Ladder?

Posted

It's probably the fact that the table global_reg_value does not works this way anymore.
To check it, what rev of rAthena are you using?

Posted (edited)

 

Posted Today, 09:25 AM

It's probably the fact that the table global_reg_value does not works this way anymore.

To check it, what rev of rAthena are you using?

im try to figure out what are you saying I do apologies but im new in scripting and i have no idea about this XD

 

how to checking the rev of rathena that im using..

Edited by jatz05
Posted (edited)
I updated the mechanics of the Script you posted, try it:

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
* ~~~~~~~~ Euphy's MVP Ladder v1.3 ~~~~~~~~ *

* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */

prontera,148,170,6    script    MVP Ladder    891,{

    mes "[Rank MVP]";

    mes "Hello.";

    mes "What are you doing here";

    next;

    switch(select("Check Ranking.:My points.:Nothing...")) {

        case 1:

            mes "[Rank MVP]";

            query_sql("SELECT char_id, CAST(`value` AS SIGNED) FROM `char_reg_num` WHERE `key` = 'MVP_Rank' ORDER BY CAST(`value` AS SIGNED) DESC LIMIT 20",.@cid,.@value);

            for(set .@i,0; .@i<getarraysize(.@cid); set .@i,.@i+1) {

                query_sql("SELECT `name` FROM `char` WHERE char_id = "+.@cid[.@i]+";",.@j$);

                set .@name$[.@i], .@j$;

            }

            if (!getarraysize(.@cid))

                mes "The rankings are empty.";

            else for(set .@i,0; .@i<getarraysize(.@cid); set .@i,.@i+1)

            mes "["+(.@i+1)+] "+.@name$[.@i]+" ~ "+.@value[.@i]+" kills";

            close;

            

        case 2:

            mes "[Rank MVP]";

            mes "You killed "+((MVP_Rank)?"^0055FF"+MVP_Rank:"no")+"^000000 MVP"+((MVP_Rank == 1)?".":"s.");

            close;

            case 3:

            close;

    }

OnNPCKillEvent:

    if (getmonsterinfo(killedrid,22)) {

        set MVP_Rank, MVP_Rank+1;

    if (MVP_Rank == 1)

        query_sql("INSERT INTO `char_reg_num` (`char_id`,`key`,`index`,`value`) VALUES ("+getcharid(0)+",'MVP_Rank','0',1)");

    else

        query_sql("UPDATE `char_reg_num` SET `value` = '"+MVP_Rank+"' WHERE char_id = "+getcharid(0)+" AND `key` ='MVP_Rank'");

        dispbottom "~ You killed "+MVP_Rank+" MVP"+((MVP_Rank == 1)?"":"s")+". ~";

        dispbottom " ~ Reward: Cash +15 ~ ";

        set #CASHPOINTS, #CASHPOINTS + 15;

        specialeffect2 313;

    }

    end;

}

Let me know if there is any errors.

sir how can i give you a credits in helping me! its working love it!

Edited by Emistry
Please use CODEBOX.

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