How To Do This
#1

Hi I'm working on an A/D script. I was wondering if I use:

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
How do I add all the damage a certain player gives together in a round to display his total damage given. Like, The Player who gave the Most damage?
Reply
#2

here: (should work)
pawn Код:
new PlayerTotalDamageGiven[MAX_PLAYERS];

public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
PlayerTotalDamageGiven[issuerid] = amout++;
return 1;
}
the player that damage the most idk how to make
Reply
#3

THat aboce +
THis when you want to work it out

pawn Код:
new stat;
new name[MAX_PLAYER_NAME];
for(new i = 0; i<MAX_PLAYERS; i++)
{
     if(stat<PlayerTotalDamageGiven[i])
     {
         stat = PlayerTotalDamageGiven[i];
         GetPlayerName(i, name, MAX_PLAYER_NAME);
       }
}
Then place the info where you want it

For example...

pawn Код:
format(string, sizeof(string), "%s did the most damge this round" name);
 SendClientMessageToAll(COLOUR, string);
Reply
#4

xkirll I get a tag mismatch on yours..:S
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)