Jump to content
  • 0

Sql function in npc


_Darius_

Question


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   0
  • Joined:  05/26/12
  • Last Seen:  

Had to do some form of these classes were only for ranking first time? I tried doing the following, the sql command would check in ranking_race_level `table` table `class` class now had there in the rankings simply ignore it. But it gave error, someone could correct my sql command?

 

NPC:

L_RANK_CLASS:
	if(BaseLevel == $BaseMax && JobLevel == $JobMax){
		if( Class == Job_Super_Novice && .end_ev_sn == 0){
			set $win_sn$,strcharinfo(0);
			set Zeny,Zeny + $premio_Z;
			getitem 18779,1;
			query_sql"INSERT INTO `ranking_race_level` (`name`,`class`,`date`,`parents`) VALUES ('"+strcharinfo(0)+"','Super Novice','"+@time$+"','0')";
			announce "O Jogador "+ $win_sn$ +" foi o primeiro Super Aprendiz a atingir o Nível MÁXIMO !!",8;
			query_sql("select `class` from `ranking_race_level` ORDER BY fame DESC LIMIT 1", `class`);
			sleep 2000;
			announce "Ele foi recompensado com um Panda Ears[1] e uma quantia considerável de Zenys !!",8;
			sleep 2000;
			announce "Ele é um exemplo para os Aprendizes de toda Rune-Midgard !!",8;
			set .end_ev_sn,1;
			end;
			}
			if( Class == Job_Super_Novice && .end_ev_sn < 10){
				query_sql"INSERT INTO `ranking_race_level` (`name`,`class`,`date`,`parents`) VALUES ('"+strcharinfo(0)+"','Super Novice','"+@time$+"','2')";
				set .end_ev_sn,.end_ev_sn+1;
				end;
			}	

Command SQL:

 

query_sql("select `class` from `ranking_race_level` ORDER BY fame DESC LIMIT 1", `class`);

 

Error:

semttulorhd.png

 

I hope you can help me, thanks

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  


query_sql "SELECT `class` FROM `ranking_race_level` ORDER BY `fame` DESC LIMIT 1",@class;

  • Upvote 1
Link to comment
Share on other sites


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

Btw you don't use the variable from this query, why don't remove this line ?

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