Jump to content
  • 0
DEsMOn

[Warning]: script:query_sql: Too many columns, discarding last 3 columns.

Question

Hello Guys,

I'm Getting this in my CMD how to solve this?

[Warning]: script:query_sql: Too many columns, discarding last 3 columns.
[Debug]: Source (NPC): MVPLadder (invisible/not on a map)
 

/---- MvP Ladder Logic Script

-	script	MVPLadder	-1,{

OnInit:
// Config
	.map_killannounce = 1; // announce when MVP is dead on the map where the MVP was killed : 0 - off, 1 - o
	.killannounce = 1; // announce when MVP is dead globally : 0 - off, 1 - on
	.gmnokill = 0; // GMs are not suppose to kill MVP. A GM with <this number> level or higher will do nothing. IF set to 60, GM60 and above kill any player will not get anything : 0 - off

//	.min_gm_menu = 90; // minimum level of GM can use the GM menu on ladder npc

	.showtotal = 20; // show the length of ladder.
	.showpage = 10;	// set the views per page.

	.showstatue = 5; // number of statues. This number must match with the number of duplicates at the end of the script
	.fix_custom_sprite = false; // if your server has custom animated sprite that overlaps the sprite animation repeatedly on the statues, enable this

// Config ends ------------------------------------------------------------------------------------------

//	to prevent bug happen
	if (.gmnokill <= 0) .gmnokill = 100;

	sleep 1;
	
OnTimer30000: // refresh statues every 30 seconds. Note the `char` table is unrealiable, player still need to perform certain task to save the character -> see 'save_settings' in conf\map-server.conf
	[email protected]$ = "SELECT `char`.`char_id`, `char`.`name`, `char`.`guild_id`, `char`.`class`,"
			 + "`char`.`sex`, `char`.`hair`, `char`.`hair_color`, `char`.`clothes_color`,"
			 + "`char`.`body`, `char`.`head_top`, `char`.`head_mid`, `char`.`head_bottom`, `char`.`robe`,"
	         + "SUM(`mvpladder`.`kills`)"
	         + "FROM `char` RIGHT JOIN `mvpladder` ON `char`.`char_id` = `mvpladder`.`char_id` GROUP BY `char`.`char_id` ORDER BY `kills` DESC LIMIT "+ .showstatue;
	[email protected] = query_sql([email protected]$, [email protected], [email protected]$, [email protected]_id, [email protected], [email protected]$, [email protected], [email protected]_color, [email protected]_color, [email protected], [email protected]_top, [email protected]_mid, [email protected]_bottom, [email protected], [email protected]);
	if (.fix_custom_sprite) {
		for ([email protected] = 0; [email protected] < [email protected]; [email protected]) {
			setunitdata .statue[[email protected] +1], UNPC_HEADTOP, 0;
			setunitdata .statue[[email protected] +1], UNPC_HEADMIDDLE, 0;
			setunitdata .statue[[email protected] +1], UNPC_HEADBOTTOM, 0;
			setunitdata .statue[[email protected] +1], UNPC_ROBE, 0;
		}
	}
	for ([email protected] = 0; [email protected] < [email protected]; [email protected]) {
		setunitdata .statue[[email protected] +1], UNPC_CLASS, [email protected][[email protected]];
		setunitdata .statue[[email protected] +1], UNPC_SEX, ([email protected]$[[email protected]] == "F")? SEX_FEMALE:SEX_MALE;
		setunitdata .statue[[email protected] +1], UNPC_HAIRSTYLE, [email protected][[email protected]];
		setunitdata .statue[[email protected] +1], UNPC_HAIRCOLOR, [email protected]_color[[email protected]];
		setunitdata .statue[[email protected] +1], UNPC_CLOTHCOLOR, [email protected]_color[[email protected]];
		setunitdata .statue[[email protected] +1], UNPC_BODY2, [email protected][[email protected]];
		setunitdata .statue[[email protected] +1], UNPC_HEADTOP, [email protected]_top[[email protected]];
		setunitdata .statue[[email protected] +1], UNPC_HEADMIDDLE, [email protected]_mid[[email protected]];
		setunitdata .statue[[email protected] +1], UNPC_HEADBOTTOM, [email protected]_bottom[[email protected]];
		setunitdata .statue[[email protected] +1], UNPC_ROBE, [email protected][[email protected]];
		setnpcdisplay "mvp_ladder_statue#"+([email protected] +1), [email protected]$[[email protected]];
		.statue_name$[[email protected] +1] = [email protected]$[[email protected]];
		.statue_guild$[[email protected] +1] = getguildname([email protected]_id[[email protected]]);
		.statue_kills[[email protected] +1] = [email protected][[email protected]];
	}
	for ([email protected] = [email protected]; [email protected] < .showstatue; [email protected])
		setunitdata .statue[[email protected] +1], UNPC_CLASS, HIDDEN_WARP_NPC;
	initnpctimer;
	end;

OnNPCKillEvent: // Logic to detect when a MvP is killed
	if (getmonsterinfo(killedrid, MOB_MVPEXP) > 0) {
		[email protected]IfKillExistQuery$ = "SELECT char_id, mob_id, kills FROM mvpladder WHERE char_id = '" + getcharid(0) + "' AND mob_id = '" + killedrid + "';";
		if (query_sql([email protected]$) > 0) { // Exist a kill of that MVP so +1 to kill count
			[email protected]$ = "UPDATE mvpladder SET kills = kills + 1 WHERE char_id = '" + getcharid(0) + "' AND mob_id = '" + killedrid + "'";
		} else { // Create a new kill of specific MVP
			//[email protected]$ = "INSERT INTO mvpladder (char_id, mob_id, kills) VALUES ('" + getcharid(0) + "','" + killedrid + "','1');";
			[email protected]$ = "INSERT INTO mvpladder (`char_id` , `mob_id` , `kills`) VALUES ('" + getcharid(0) + "','" + killedrid + "','1');";
		}
		query_sql([email protected]$);
	}
	end;
}

//---- MvP Ladder Info NPC

prontera,169,175,5	script	MVP Ladder	512,{
	[email protected]$ = strnpcinfo(0);
	while (1) {
		switch (select("^f44336Top MVP killer list^000000","^E69138Top MVP killed list^000000","My Information")) {
		case 1:
			[email protected]$ = "SELECT t1.char_id, SUM(t1.kills), t2.name " +
								 "FROM `mvpladder` t1 " +
								 "INNER JOIN `char` t2 " +
								 "ON t1.char_id = t2.char_id " +
								 "GROUP BY t1.char_id " +
								 "ORDER BY t1.kills DESC " +
								 "LIMIT " + getvariableofnpc(.showtotal, "MVPLadder") + ";";
			[email protected] = query_sql([email protected]$, [email protected], [email protected], [email protected]$);
			if ([email protected]) {
				mes "The ladder currently is empty.";
				next;
			}
			for ([email protected] = 0; [email protected] < [email protected]; [email protected] += getvariableofnpc(.showpage,"MVPLadder")) {
				for ([email protected] = [email protected]; [email protected] < (getvariableofnpc(.showpage,"MVPLadder") + [email protected]) && [email protected] < [email protected]; [email protected])
					mes "^996600" + ([email protected]+1) + ": ^006699" + [email protected]$[[email protected]] + " ^00AA00[^FF0000" + [email protected][[email protected]] + " MvP^00AA00 killed]^000000";
				next;
			}
			break;
			
		case 2:
			[email protected]$ = "SELECT char_id, mob_id, SUM(kills) " +
								 "FROM `mvpladder` " +
								 "GROUP BY mob_id " +
								 "ORDER BY kills DESC " +
								 "LIMIT " + getvariableofnpc(.showtotal, "MVPLadder") + ";";
			[email protected] = query_sql([email protected]$, [email protected], [email protected], [email protected]);
			if ([email protected]) {
				mes "The ladder currently is empty.";
				next;
			}
			for ([email protected] = 0; [email protected] < [email protected]; [email protected] += getvariableofnpc(.showpage,"MVPLadder")) {
				for ([email protected] = [email protected]; [email protected] < (getvariableofnpc(.showpage,"MVPLadder") + [email protected]) && [email protected] < [email protected]; [email protected]) {
					mes "^996600" + ([email protected]+1) + ": ^006699" + strmobinfo(1, [email protected][[email protected]]) + " ^FF0000MvP ^00AA00[Killed ^FF0000" + [email protected][[email protected]] + " ^00AA00times]^000000";
				}
				next;
			}
			query_sql("SELECT SUM(kills) FROM mvpladder;", [email protected]);
			mes "Congratulation, "+strcharinfo(0) +" check your information below";
			mes "^006699Total MvP Kills:^000000 [^FF0000" + [email protected][0] + " ^00AA00kills]^000000";
			break;
			
		case 3:
			[email protected]$ = "SELECT char_id, mob_id, SUM(kills) " +
								"FROM `mvpladder` " +
								"WHERE char_id = '" + getcharid(0) + "'" +
								"ORDER BY kills DESC;";
			[email protected] = query_sql([email protected]$, [email protected], [email protected], [email protected]);
			if ([email protected]) {
				mes "The ladder currently is empty.";
				next;
			}
			[email protected] = 0;
			for ([email protected] = 0; [email protected] < [email protected]; [email protected] += getvariableofnpc(.showpage,"MVPLadder")) {
				for ([email protected] = [email protected]; [email protected] < (getvariableofnpc(.showpage,"MVPLadder") + [email protected]) && [email protected] < [email protected]; [email protected] ) {	
					mes "^996600" + ([email protected]+1) + ": ^006699" + strmobinfo(1, [email protected][[email protected]]) + " ^FF0000MvP ^00AA00[Killed ^FF0000" + [email protected][[email protected]] + " ^00AA00times]^000000";
					[email protected] = [email protected] + [email protected][[email protected]];
				}
				next;
			}
			mes "Congratulation, "+strcharinfo(0) +" check your information below";
			mes "^006699Total Own MvP Kills:^000000 [^FF0000" + [email protected] + " ^00AA00kills]^000000";
			break;
		case 4:
			callfunc "qsho2op",1;
	end;
        }
OnInit:
	initnpctimer;
	end;
OnTimer1000:
	showscript("MVP Ladder");
	setnpctimer 0;
	end;
    }
close;

}

//---- MSG board NPCs

-	script	mvp_ladder_statue	-1,{
	[email protected] = getelementofarray(getvariableofnpc(.npcgid, "MVPLadder"), getnpcid(0));
	mes "^996600[TOP "+ [email protected] +"]";
	mes "^006699Name : "+ getelementofarray(getvariableofnpc(.statue_name$, "MVPLadder"), [email protected]);
	[email protected]$ = getelementofarray(getvariableofnpc(.statue_guild$, "MVPLadder"), [email protected]);
	mes "^00AAAAGuild : "+(([email protected]$ == "null")? "^AAAAAANone": [email protected]$);
	mes "^00AA00Total MVP Kills : ["+ getelementofarray(getvariableofnpc(.statue_kills, "MVPLadder"), [email protected]) +"]";
	close;

OnInit:
	[email protected] = strnpcinfo(2);
	set getvariableofnpc(.statue[[email protected]], "MVPLadder"), getnpcid(0);
	set getvariableofnpc(.npcgid[getnpcid(0)], "MVPLadder"), [email protected];
	end;
}


prontera,176,175,3	duplicate(mvp_ladder_statue)	mvp_ladder_statue#1	1_F_MARIA
prontera,179,172,3	duplicate(mvp_ladder_statue)	mvp_ladder_statue#2	1_F_MARIA
prontera,182,169,3	duplicate(mvp_ladder_statue)	mvp_ladder_statue#3	1_F_MARIA
prontera,185,166,3	duplicate(mvp_ladder_statue)	mvp_ladder_statue#4	1_F_MARIA
prontera,188,163,3	duplicate(mvp_ladder_statue)	mvp_ladder_statue#5	1_F_MARIA

prontera,176,175,5	script	 #top1	111,{
OnInit:
	initnpctimer;
	end;
OnTimer1000:
	showscript("Top-1 MVP Killer");
	setnpctimer 0;
	end;
}

prontera,179,172,5	script	 #top2	111,{
OnInit:
	initnpctimer;
	end;
OnTimer1000:
	showscript("Top-2 MVP Killer");
	setnpctimer 0;
	end;
}

prontera,182,169,5	script	 #top3	111,{
OnInit:
	initnpctimer;
	end;
OnTimer1000:
	showscript("Top-3 MVP Killer");
	setnpctimer 0;
	end;
}

prontera,185,166,5	script	 #top4	111,{
OnInit:
	initnpctimer;
	end;
OnTimer1000:
	showscript("Top-4 MVP Killer");
	setnpctimer 0;
	end;
}

prontera,188,163,5	script	 #top5	111,{
OnInit:
	initnpctimer;
	end;
OnTimer1000:
	showscript("Top-5 MVP Killer");
	setnpctimer 0;
	end;
}

 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
if (query_sql([email protected]$) > 0) { // Exist a kill of that MVP so +1 to kill count

change to

if (query_sql([email protected]$, [email protected], [email protected], [email protected]$) > 0) { // Exist a kill of that MVP so +1 to kill count

 

  • Love 1
Link to comment
Share on other sites

  • 0
2 hours ago, Emistry said:
if (query_sql([email protected]$) > 0) { // Exist a kill of that MVP so +1 to kill count

change to

if (query_sql([email protected]$, [email protected], [email protected], [email protected]$) > 0) { // Exist a kill of that MVP so +1 to kill count

 

Thank you sir Emistry SIR...its fixed now....!!

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

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.