@Aleos Thanks.
I changed it now like this:
algaia,205,161,4 script Test Rank 100,{
mes "[blacksmith Ranking]";
query_sql "SELECT `fame`,`name` FROM `char` WHERE `fame`>0 AND (`class`='10' OR `class`='4011' OR `class`='4033' OR `class`='4058' OR `class`='4064' OR `class`='4100') ORDER BY `fame` DESC LIMIT 0,1", .@fame$, .@name$;
query_sql "SELECT `fame`,`name` FROM `char` WHERE `fame`>0 AND (`class`='10' OR `class`='4011' OR `class`='4033' OR `class`='4058' OR `class`='4064' OR `class`='4100') ORDER BY `fame` DESC LIMIT 1,2", .@fame2$, .@name2$;
query_sql "SELECT `fame`,`name` FROM `char` WHERE `fame`>0 AND (`class`='10' OR `class`='4011' OR `class`='4033' OR `class`='4058' OR `class`='4064' OR `class`='4100') ORDER BY `fame` DESC LIMIT 2,3", .@fame3$, .@name3$;
mes "=======================";
mes "Top 1 Blacksmith";
mes ""+ .@name$ +" with fame of: "+ .@fame$ +".";
set rank,1;
mes "=======================";
mes "Top 2 Blacksmith";
mes ""+ .@name2$ +" with fame of: "+ .@fame2$ +".";
set rank,2;
mes "=======================";
mes "Top 3 Blacksmith";
mes ""+ .@name3$ +" with fame of: "+ .@fame3$ +".";
mes "=======================";
set rank,3;
close;
OnPCLoginEvent:
if(rank == 1){
atcommand "@aura 701";
dispbottom "You are on the first place.";
}
if(rank == 2){
atcommand "@aura 701";
dispbottom "You are on the second place.";
}
if(rank == 3){
atcommand "@aura 701";
dispbottom "You are on the third place.";
}
end;
}
My problem is now, how to set
set rank,1; , set rank,2; and set rank,3;
each ppls without talking the npc.
If I speak with the npc, I get the set rank,3;
I need it to get automatic. X_X
Sry for my english.