try this. i haven't tested it.
/*
ALTER TABLE `char` ADD `pvp_kill` INT(11) UNSIGNED NOT NULL DEFAULT '0' AFTER `fame`;
*/
payon,193,104,4 script PVP Warper 630,{
doevent "pvp_rank_main::OnTalk";
}
- script pvp_rank_main -1,{
OnTalk:
mes "[PvP Room Master]";
mes "Where do you want to go?";
next;
switch ( select (
"Grand Arena [ "+getmapusers("grandarena")+" ]",
"^ff0000[ No Points ]^000000 Izlude PVP Room [ "+getmapusers("pvp_y_1-2")+" ]",
( getgmlevel() >= 99 ) ? "^FF0000[GM] Reset PVP Ranking^000000":""
)) {
case 1: // Grand Arena
if ( getmapusers("grandarena") >= 100 ) {
mes "The Grand Arena is full!";
close;
}
if ( BaseLevel < 50 ) {
mes "Excuse me, but";
mes "you need to be at least level 50 or above!";
close;
}
warp "grandarena",0,0;
announce ""+strcharinfo(0)+" entered Grand Arena PVP ROOM!", bc_all, 0xCCFFFF;
end;
case 2: // Izlude PVP Room
if ( getmapusers("pvp_y_1-2") >= 100 ) {
mes "The Izlude PVP Room is full!";
close;
}
if ( BaseLevel < 50 ) {
mes "Excuse me, but";
mes "you need to be at least level 50 or above!";
close;
}
warp "pvp_y_1-2",0,0;
announce ""+strcharinfo(0)+" entered Izlude PVP ROOM!", bc_all, 0xCCFFFF;
end;
case 3: // GM Reset Ranking
if ( getgmlevel() < 99 ) {
mes "You do not have permission to perform this action.";
close;
}
mes "[PvP Room Master]";
mes "Reset Ranking? This action cannot be undone.";
if ( select( "Confirm", "Cancel" ) == 1 ) {
query_sql( "UPDATE `char` SET `pvp_kill` = 0 WHERE `pvp_kill` > 0" );
mes "PvP ranking has been reset.";
}
close;
default: // PvP Rankings
mes "[PvP Room Master]";
mes "PvP Rankings:";
query_sql( "SELECT `name`, `pvp_kill` FROM `char` WHERE `pvp_kill` > 0 ORDER BY `pvp_kill` DESC LIMIT 10", .@name$, .@pvp_kill );
.@size = getarraysize( .@name$ );
if ( .@size == 0 ) {
mes "No PvP rankings available yet.";
} else {
for ( .@i = 0; .@i < .@size; .@i++ ) {
mes "["+(.@i + 1 )+"] "+.@name$[.@i]+" - "+.@pvp_kill[.@i]+" kill(s)";
}
}
close;
}
}