Scofield Posted April 18, 2013 Posted April 18, 2013 (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 April 18, 2013 by cumbe11 Quote
Pinoy Fury Posted April 19, 2013 Posted April 19, 2013 Execute this in the npc: query_sql "DELETE FROM `global_reg_value` WHERE str='MVPRank'"; Quote
Scofield Posted April 19, 2013 Author Posted April 19, 2013 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 Quote
Pinoy Fury Posted April 19, 2013 Posted April 19, 2013 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; Quote
Scofield Posted April 19, 2013 Author Posted April 19, 2013 where in my script I add it? could you give me an example? Quote
Pinoy Fury Posted April 19, 2013 Posted April 19, 2013 You can add it anywhere before the end of the script. You can add it below OnInit. 1 Quote
Scofield Posted April 19, 2013 Author Posted April 19, 2013 It did not work, I've added in the wrong way. Quote
Capuche Posted April 19, 2013 Posted April 19, 2013 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 2 Quote
Question
Scofield
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
8 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.