Jump to content

Question

Posted (edited)

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

8 answers to this question

Recommended Posts

Posted

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;

Posted
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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...