Jump to content
  • 0

MVP Ladder Error / help please


JassMax

Question


  • Group:  Members
  • Topic Count:  65
  • Topics Per Day:  0.02
  • Content Count:  235
  • Reputation:   0
  • Joined:  05/03/13
  • Last Seen:  

I having getting this error 
and mvp ladder not working 

My Script here

prontera,30,165,5	script	MVP Shop	619,{
	if(!.itemid[1])
		donpcevent "::OnCustomInit";
	while(1) {
		mes .npcname$;
		mes "Howdy "+strcharinfo(0)+", What do you want to do?";
		switch(select("View MVP Ladder.:Exchange MVP Points.:Nothing, thanks.")) {
			case 1:
				next;
				mes .npcname$;
				mes "The Top 10 MVP's are:";
				query_sql("SELECT `char_id`,`total_kills` FROM `mvp_ladder` ORDER BY `total_kills` DESC LIMIT 10",.@char_id,.@kills);
				for (set .@i,0; .@i < getarraysize(.@char_id); set .@i,.@i + 1) {
					query_sql("SELECT `name`,`class` FROM `char` WHERE `char_id` = '" + .@char_id[.@i] + "' LIMIT 1",.@char_name$,.@class_id);
					mes .@i + 1 + ".^0000FF" + .@char_name$[0] + "^000000 -- (^cc55ff" + jobname(.@class_id[0]) + "^000000) - [^FF33CC" + .@kills[.@i] + "^000000]";
				}
				if( select( "Back to menu.:Bye bye.") == 1) {
					next;
					break;
				} else 
					close;
			case 2:
				next;
				mes .npcname$;
				mes "Howdy "+strcharinfo(0)+", I can exchange the following items for MVP Points";
				mes "Current MVP Points: ^ff0000"+#MVPPOINTS+"^000000.";
				set .@i,select(.menuoptions$);
				next;
				if(!.@i) {
					mes "^FF0000 Error Ocurred, please take a screenshot and report to gamemaster.";
					close;
				} else if( .@i > getarraysize( .itemid ) ) {
					break;
				}
				mes .npcname$;
				mes "To get ^9f80ff"+getitemname( .itemid[.@i] )+"^000000 you need: ^ff0000"+.mvppoints[.@i]+"^000000.";
				mes "Do you want to exchange it?";
				if( select("Yes, please.:No, thanks.") == 2) {
					next;
					break;
				}
				next;
				mes .npcname$;
				if( #MVPPOINTS < .mvppoints[.@i] ) {
					mes "You dont have enough MVP Points, please get them and talk to me again.";
					next;
					break;
				}
				set .@tem_points,#MVPPOINTS - .mvppoints[.@i];
				mes "Are you really sure that you want to Exchange ^9f80ff"+getitemname( .itemid[.@i] )+"^000000 for ^ff0000"+#MVPPOINTS+"^000000?";
				mes "MVP Points after transaction: ^ff0000"+.@tem_points+"^000000.";
				if( select("No, thanks.:Yes, please.") == 1) {
					next;
					break;
				} if( #MVPPOINTS < .mvppoints[.@i] ) {
					mes "You dont have enough MVP Points, please get them and talk to me again.";
					next;
					break;
				}
				set #MVPPOINTS,#MVPPOINTS - .mvppoints[.@i];
				getitem .itemid[.@i],1;
				logmes "AccountID: "+getcharid(3)+", CharID: "+getcharid(0)+", Bought "+getitemname(.itemid[.@i])+"("+.itemid[.@i]+")";
				if( select( "Back to menu.:Bye bye.") == 2) {
					next;
					break;
				} else 
					close;
			break;
			default:
				mes "See ya.";
			close;
		}
	}
	end;

OnInit:
OnCustomInit:
	setarray .itemid[1],7364,20405,7361,7363,4302,4441,7338,4367,4145,4357,4361,4359,4365,4363,20412,20411;
	setarray .mvppoints[1],50,100,200,250,1000,1000,3500,3500,3500,3500,3500,3500,3500,3500,8000,15000;
	set .npcname$,"^0000FF[Nyantastic Mob]^000000";
	set .menuoptions$,"";
	for(set .@i,1; .@i < getarraysize( .itemid ); set .@i,.@i+1) {
		set .menuoptions$,.menuoptions$+"[^cc55ff "+ getitemname( .itemid[.@i] ) +" ^000000]->^ff0000"+.mvppoints[.@i]+"^000000";
		if( .@i < getarraysize( .itemid ) )
			set .menuoptions$, .menuoptions$+":";
	}
	set .menuoptions$, .menuoptions$+":Nothing thanks.";
end;
}




Error in  CMD

Screenshot_47.jpg


and in the game its shows Empty

Screenshot_48.jpg

Link to comment
Share on other sites

5 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Table ... doesn't exist.. what does that mean  /?

Answer : that means the table doesn't exist !

Maybe import it in mysql ?

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

Yeah you're missing the sql table but it also looks like your missing other parts of the script like where it inserts values into the sql table...

CREATE TABLE `ragnarok`.`mvp_ladder` (
  `char_id` INT(11) UNSIGNED NOT NULL,
  `total_kills` INT(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`char_id`))
ENGINE = MyISAM
DEFAULT CHARACTER SET = utf8;
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  65
  • Topics Per Day:  0.02
  • Content Count:  235
  • Reputation:   0
  • Joined:  05/03/13
  • Last Seen:  

 

Yeah you're missing the sql table but it also looks like your missing other parts of the script like where it inserts values into the sql table...

here is other script which u were talking

-	script	MVP_Points	-1,{

OnNPCKillEvent:
	if(!.init)
		donpcevent "::OnCustomInit";
	for (set .@i, 0; .@i<getarraysize(.MVPID); set .@i, .@i + 1) {
		if(killedrid == .MVPID[.@i]) {
			set #MVPPOINTS, #MVPPOINTS + .MVPID_POINTS[.@i];
			message strcharinfo(0),"You earned "+.MVPID_POINTS[.@i]+" MVP Points for killing "+getmonsterinfo(.MVPID[.@i],MOB_NAME)+". You currently have ["+#MVPPOINTS+"] MVP Points.";
			if (!query_sql("SELECT `total_kills` FROM `mvp_ladder` WHERE `char_id` = '" + getcharid(0) + "' LIMIT 1",.@kills)) {
				query_sql("INSERT INTO `mvp_ladder` VALUES ('" + getcharid(3) + "','" + getcharid(0) + "','1','1')");
			} else {
				set .@kills[0],.@kills[0] + 1;
				query_sql("UPDATE `mvp_ladder` SET `total_kills` = '" + .@kills[0] + "',`current_points`= '"+#MVPPOINTS+"' WHERE `char_id` = '" + getcharid(0) + "' LIMIT 1");
			}
			break;
		}
	}
end;

OnInit:
OnCustomInit:
	set .init,1;
	setarray .MVPID[0],1511,1785,1630,1719,1389,1418,1252,1768,1086,1734,1251,1779,1688,1623,1583,1708,1685,1658,-1,2000,-1,1751,-1,2011,-1,2018,-1,1647,1874,1871,1648,1917,1502,1646,1650,1649,1651,1832,-1;
	setarray .MVPID_POINTS[0],1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,-0,2,-0,3,-0,10,-0,35,-0,50,50,50,50,50,50,50,50,50,50,50,-0;
end;

}

 

this is 2nd scripts work with 1st npc

one is mvp ladder and other is mvp point system

could you please make sql table? cuz i dont know how to make. and your old table not working

thanks in advance

 

Bump~

Table ... doesn't exist.. what does that mean  /?

Answer : that means the table doesn't exist !

Maybe import it in mysql ?

___

 

i dont have sql table xD

dont know how to make

Edited by JassMax
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

Delete the other one and do this instead...

CREATE TABLE `ragnarok`.`mvp_ladder` (
  `account_id` INT(11) UNSIGNED NOT NULL,
  `char_id` INT(11) UNSIGNED NOT NULL,
  `total_kills` INT(11) NOT NULL DEFAULT '0',
  `current_points` INT(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`account_id`))
ENGINE = MyISAM
DEFAULT CHARACTER SET = utf8;
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  65
  • Topics Per Day:  0.02
  • Content Count:  235
  • Reputation:   0
  • Joined:  05/03/13
  • Last Seen:  

 

Delete the other one and do this instead...

CREATE TABLE `ragnarok`.`mvp_ladder` (
  `account_id` INT(11) UNSIGNED NOT NULL,
  `char_id` INT(11) UNSIGNED NOT NULL,
  `total_kills` INT(11) NOT NULL DEFAULT '0',
  `current_points` INT(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`account_id`))
ENGINE = MyISAM
DEFAULT CHARACTER SET = utf8;

 

thanks i will try and let you know

@Skorm thanks man

its working great  /no1

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