How can i create a top?
#1

i want to crate a top

new participants = 10,damage[MAX_PLAYERS],string[128];

how can i get max value of damage?
for use in command like /top

YCMD:top(playerid, params[], help)
{
for(new i = 0; i <= participants; i++) {
if(damage[i] == 0) return SendClientMessage(playerid,COLOR_WHITE,"No one!");
format(string,128,"top %d with %d damage",i,damage[i]);
SendClientMessage(playerid,COLOR_WHITE,string);
return 1;
}

how can i get max value of damage?
Reply
#2

PHP код:
    new MaxKills;
    new 
HighestPlayerID;
    for(new 
i=0MAX_PLAYERSi++)
    {
        if (
/*Player's kills*/ MaxKills)
        {
            
HighestPlayerID i;
            
MaxKills /*Player's Kills*/;
        }
    }
    new 
string[72];
    
format(stringsizeof(string), "ID:%d with %d Kills"HighestPlayerIDMaxKills);
    
SendClientMessage(playerid, -1string); 
You'll have to replace the commented variables.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)