Jump to content
  • 0

MVP LADDER


Jerson A Tadios

Question


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   0
  • Joined:  10/28/15
  • Last Seen:  

 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;
}
Link to comment
Share on other sites

8 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:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   0
  • Joined:  10/28/15
  • Last Seen:  

sir  E M I S T R Y i've try your code but i cant click the npc :(

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   0
  • Joined:  10/25/16
  • Last Seen:  

Ninja i have choose reset in the game but still nothing happen.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   0
  • Joined:  10/25/16
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  21
  • Reputation:   2
  • Joined:  07/12/17
  • Last Seen:  

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
      * ~~~~~~~~  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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  21
  • Reputation:   0
  • Joined:  08/12/17
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  78
  • Topics Per Day:  0.03
  • Content Count:  436
  • Reputation:   167
  • Joined:  12/12/17
  • Last Seen:  

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