SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 14/08/2018, 04:44 PM   #1
severance
Big Clucker
 
Join Date: Apr 2015
Posts: 121
Reputation: 8
Default how to pick 3 best players

Hello i'm working on a sophisticated damage system and i want to pick 3 best players who did best damage, example:

(1) %s did 400 damage.
(2) %s did 300 damage.
(3) %s did 200 damage.

I need to know how can you take those 3 players and put them on a list like i stated before??



Highly appreciated any threads/tutorials or a tip guys.
severance is offline   Reply With Quote
Old 15/08/2018, 06:29 AM   #2
Heress
Huge Clucker
 
Heress's Avatar
 
Join Date: Mar 2018
Location: Lithuania
Posts: 210
Reputation: 7
Default Re: how to pick 3 best players

http://forum.sa-mp.com/showthread.php?t=330005
You can do something like this....
__________________
==============
Sorry for my bad English
Heress is offline   Reply With Quote
Old 15/08/2018, 09:39 AM   #3
severance
Big Clucker
 
Join Date: Apr 2015
Posts: 121
Reputation: 8
Default Re: how to pick 3 best players

Not that i already have a damage system, but i want to pick up 3 best players each 15 minutes in chat like i told above.
Example: 3 best player money, i need to make a check/loop through everyone in the server and only picking up 3 players which has high numbers
severance is offline   Reply With Quote
Old 15/08/2018, 10:54 AM   #4
KinderClans
Banned
 
Join Date: May 2018
Location: Italy
Posts: 736
Reputation: 43
Default Re: how to pick 3 best players

Something like this?

pawn Code:
CMD:richlist(playerid)
{
    new data[MAX_PLAYERS][2];
    foreach (new i : Player)
    {
        data[i][0] = GetPlayerMoney(i);
        data[i][1] = i;
    }

    QuickSort_Pair(data, true, 0, Iter_Count(Player));

    SendClientMessage(playerid, -1, "* Top 5 rich players currently online:");
    new buf[150];
    for (new i; i < 5; i++)
    {
        if (data[i][0])
        {
            format(buf, sizeof(buf), "%i. %s (%i) - %i$", i + 1, ReturnPlayerName(data[i][1]), data[i][1], data[i][0]);
            SendClientMessage(playerid, COLOR_DODGER_BLUE, buf);
        }
    }
    return 1;
}
KinderClans is offline   Reply With Quote
Old 15/08/2018, 11:28 AM   #5
severance
Big Clucker
 
Join Date: Apr 2015
Posts: 121
Reputation: 8
Default Re: how to pick 3 best players

Yeah, i'll try this one
severance is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What OS should i pick for my next VPS ? CraZyCaT Everything and Nothing 13 11/05/2012 04:38 PM
just one pick... Rafa Scripting Help 5 12/02/2012 06:34 PM
[HELp] PICK decastro96 Help Archive 2 21/06/2011 07:20 PM
Pick ups marinov Help Archive 1 11/11/2010 03:39 AM
gun pick ups [HKS]dlegend Help Archive 4 11/11/2009 09:00 PM


All times are GMT. The time now is 03:38 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.