Jump to content
  • 0

Ranking MvP


Scofield

Question


  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.03
  • Content Count:  265
  • Reputation:   11
  • Joined:  01/11/13
  • Last Seen:  

I have this script that shows the ranking MvP my server, I wish it had a function to reset the ranking by the time I wanted

 

 

prontera,171,182,3    script    Ranking MvP    857,{

query_sql "SELECT `char_id`,`value` FROM `global_reg_value` WHERE `str`='MVPRank' ORDER BY ABS(value)DESC LIMIT 10",@char_id,@pontos_mvp;
dispbottom "Position.  Player:  MVPs Dead: ";
dispbottom " ";
for(set @i,0;@i<=9;set @i,@i+1) {
    query_sql "SELECT `name` FROM `char` WHERE `char_id`='"+@char_id[@i]+"'",@nome$;
    dispbottom "["+(@i+1)+"] Nome: ["+@nome$+"] [MVPs: "+@pontos_mvp[@i]+"]";
}
close;


OnInit:
    waitingroom "[ Ranking MVP ]",0;
    end;
}
Edited by cumbe11
Link to comment
Share on other sites

8 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  37
  • Reputation:   2
  • Joined:  11/20/11
  • Last Seen:  

Execute this in the npc:

 

query_sql "DELETE FROM `global_reg_value` WHERE str='MVPRank'";

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.03
  • Content Count:  265
  • Reputation:   11
  • Joined:  01/11/13
  • Last Seen:  

how to get it implemented in my script? the idea was to just people in the staff could access the function to reset the npc

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  37
  • Reputation:   2
  • Joined:  11/20/11
  • Last Seen:  

Add this:

 

OnWhisperGlobal:
    if (getgroupid() < 20) end; //Put minimum GM level here
    query_sql "DELETE FROM `global_reg_value` WHERE str='MVPRank'";

    dispbottom "MVP Ranking has been reset.";

   end;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.03
  • Content Count:  265
  • Reputation:   11
  • Joined:  01/11/13
  • Last Seen:  

where in my script I add it? could you give me an example?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  37
  • Reputation:   2
  • Joined:  11/20/11
  • Last Seen:  

You can add it anywhere before the end of the script. You can add it below OnInit.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.03
  • Content Count:  265
  • Reputation:   11
  • Joined:  01/11/13
  • Last Seen:  

It did not work, I've added in the wrong way.

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:  

prontera,171,182,3	script	Ranking MvP	857,{

	if (getgmlevel() > 20) {
		if ( select( "Ranking", "Reset" ) -1 ) {
			query_sql "DELETE FROM `global_reg_value` WHERE `str` = 'MVPRank'";
			dispbottom "MVP Ranking has been reset.";
			close;
		}
	}
	query_sql "SELECT `global_reg_value`.`value`, `char`.`name` FROM `global_reg_value` left join `char` on `global_reg_value`.`char_id` = `char`.`char_id` "+
				"WHERE `global_reg_value`.`str`= 'MVPRank' ORDER BY ABS(value) DESC LIMIT 10", .@pontos_mvp, .@char_name$;
	dispbottom "Position.  Player:  MVPs Dead: ";
	dispbottom " ";
	if( !getarraysize( .@char_name$ ) )
		dispbottom "*Empty List*";
	else
		for( set .@i,0; .@i < getarraysize( .@char_name$ ) ; set .@i, .@i +1 )
			dispbottom "["+ ( .@i +1 ) +"] Nome: ["+ .@char_name$[.@i] +"] [MVPs: "+ .@pontos_mvp[.@i]+"]";
	close;

OnInit:
	waitingroom "[ Ranking MVP ]",0;
	end;
}

 

 

 

It did not work, I've added in the wrong way.

if (getgroupid() < 20) end; //Put minimum GM level here

getgroupid works only on rA and you don't use rA if I remember correctly

  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.03
  • Content Count:  265
  • Reputation:   11
  • Joined:  01/11/13
  • Last Seen:  

Thank you.

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