Scofield Posted April 18, 2013 Group: Members Topic Count: 109 Topics Per Day: 0.02 Content Count: 272 Reputation: 16 Joined: 01/11/13 Last Seen: 9 hours ago Share 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 Link to comment Share on other sites More sharing options...
Pinoy Fury Posted April 19, 2013 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 37 Reputation: 2 Joined: 11/20/11 Last Seen: April 10, 2020 Share Posted April 19, 2013 Execute this in the npc: query_sql "DELETE FROM `global_reg_value` WHERE str='MVPRank'"; Quote Link to comment Share on other sites More sharing options...
Scofield Posted April 19, 2013 Group: Members Topic Count: 109 Topics Per Day: 0.02 Content Count: 272 Reputation: 16 Joined: 01/11/13 Last Seen: 9 hours ago Author Share 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 Link to comment Share on other sites More sharing options...
Pinoy Fury Posted April 19, 2013 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 37 Reputation: 2 Joined: 11/20/11 Last Seen: April 10, 2020 Share 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 Link to comment Share on other sites More sharing options...
Scofield Posted April 19, 2013 Group: Members Topic Count: 109 Topics Per Day: 0.02 Content Count: 272 Reputation: 16 Joined: 01/11/13 Last Seen: 9 hours ago Author Share Posted April 19, 2013 where in my script I add it? could you give me an example? Quote Link to comment Share on other sites More sharing options...
Pinoy Fury Posted April 19, 2013 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 37 Reputation: 2 Joined: 11/20/11 Last Seen: April 10, 2020 Share Posted April 19, 2013 You can add it anywhere before the end of the script. You can add it below OnInit. 1 Quote Link to comment Share on other sites More sharing options...
Scofield Posted April 19, 2013 Group: Members Topic Count: 109 Topics Per Day: 0.02 Content Count: 272 Reputation: 16 Joined: 01/11/13 Last Seen: 9 hours ago Author Share Posted April 19, 2013 It did not work, I've added in the wrong way. Quote Link to comment Share on other sites More sharing options...
Capuche Posted April 19, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share 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 Link to comment Share on other sites More sharing options...
Scofield Posted April 19, 2013 Group: Members Topic Count: 109 Topics Per Day: 0.02 Content Count: 272 Reputation: 16 Joined: 01/11/13 Last Seen: 9 hours ago Author Share Posted April 19, 2013 Thank you. Quote Link to comment Share on other sites More sharing options...
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
Link to comment
Share on other sites
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.