top 5 killers!!!
#1

i want to check the player with the most kills and thesecond with the most kills etc using dudb system. i want to show the top 5of best killers online. how i can do that with dudb? i mean how i can show the player with the highest kills.

pls help!!
Reply
#2

Hmmm.... I want to know how to do this too,
so, I'm joining the question
Reply
#3

Thatґs easy when you know exactly what to do.
Search on this forum for "toplist". I think there is already a tutorial for this lists.
I will post the link if I find.
Reply
#4

yes but for dudb? i mean i want to load the saved info ex kills and from all players and show the first with most kills.
Reply
#5

create a loop and find who has the highest score.

every kill someone gets they get a score point.

you need to know math...
Reply
#6

pawn Код:
new best,score;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && GetPlayerScore(i) >= score)
{
best=i;
score=GetPlayerScore(i);
}
}
printf("fist best is %d - %d",best,score);

for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i)&&GetPlayerScore(i)>=score&&best!=i)
{
best=i;
score=GetPlayerScore(i);
}
}
printf("second is %d - %d",best,score);
I not tested
Reply
#7

I'm making a function for this soon, I'll keep you updated.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)