Jump to content

Question

Posted

 Hi good day please help me about the reset option for gm lvl 99 only... here the script for Euphy's Mvp Ladder 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 `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 + 1 ~ ";
		set #CASHPOINTS, #CASHPOINTS + 1;
		specialeffect2 313;
	}
	end;
		OnInit:
    waitingroom "Stylist!",0;
}

8 answers to this question

Recommended Posts

  • 0
Posted

try this

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
      * ~~~~~~~~  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.",
		( getgmlevel() >= 99 ) ? "RESET":"" ),
		"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:
			if ( select( "Confirm","Cancel" ) == 1 ) {
				query_sql("UPDATE `char_reg_num` SET `value` = '0' WHERE `key` ='MVP_Rank'");
				close2;
				addrid(0);
				MVP_Rank = 0;
				end;
			}
			close;
		default:		
			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 + 1 ~ ";
		set #CASHPOINTS, #CASHPOINTS + 1;
		specialeffect2 313;
	}
	end;
		OnInit:
    waitingroom "MVP LADDER!",0;
}
Reply
Report
Edit

  • 0
Posted (edited)

If you find something not working please make sure to post server-sided errors too. We cannot help you much if you provide inadequate information.

 

Anyway, edited Emistry's entry on the switch statement.

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
      * ~~~~~~~~  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.:"+( getgmlevel() >= 99 ) ? "RESET":""+":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:
if ( select( "Confirm","Cancel" ) == 1 ) {
query_sql("UPDATE `char_reg_num` SET `value` = '0' WHERE `key` ='MVP_Rank'");
close2;
addrid(0);
MVP_Rank = 0;
end;
}
close;
default: 
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 + 1 ~ ";
set #CASHPOINTS, #CASHPOINTS + 1;
specialeffect2 313;
}
end;
OnInit:
    waitingroom "MVP LADDER!",0;
}

please try this one.

Edited by jezznar
  • 0
Posted

I have fix this by editing the switch; 

switch(select("MVP Rank","My Ranking")) {                            -  (Without Reset)

switch(select("MVP Rank","My Ranking","Reset")) {                - (With Reset Button, only enable it when you want to do Reset, can be access to all player)

if i want to reset, i need to load the option with reset button and reset it, then edit back the script without Reset option

  • 0
Posted
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
      * ~~~~~~~~  Euphy's MVP Ladder v1.3  ~~~~~~~~ *
      * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */


prontera,144,197,3	script	MVP Ladder	891,{
mes "[Rank MVP]";
	mes "Hello.";
	mes "What are you doing here";
	next;
	switch(select("Check Ranking.","My points.",( getgmlevel() >= 99 ) ? "RESET":"" ,"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:
			if ( select( "Confirm","Cancel" ) == 1 ) {
				query_sql("UPDATE `char_reg_num` SET `value` = '0' WHERE `key` ='MVP_Rank'");
				close2;
				addrid(0);
				MVP_Rank = 0;
				end;
			}
			close;
		default:		
			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 + 1 ~ ";
		set #CASHPOINTS, #CASHPOINTS + 1;
		specialeffect2 313;
	}

	end;
		OnInit:
    waitingroom "MVP LADDER!",0;
}

Here, I've edited @Euphy MvP Ladder that @Emistry edited. (wrong bracket in switch-case)

Sorry for editing without permission

and thank you for sharing the script

  • 0
Posted

hi, the script works for me. I have question, how to make the MVP Ladder count killing MVP at instance too? Because the script works for normal spawn mvp / GM summon

thank you

  • 0
Posted (edited)
5 hours ago, lzm said:

hi, the script works for me. I have question, how to make the MVP Ladder count killing MVP at instance too? Because the script works for normal spawn mvp / GM summon

thank you

Try this:

from:
if (getmonsterinfo(killedrid,22)) {
to:
if (getmonsterinfo(killedrid,22) || strcharinfo(3) == instance_mapname("INSTANCE_MAP") ) {

not tested

Edited by pajodex

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