Getting players name
#1

How can I get a players name with the least damage on his vehicle?

pawn Код:
forward DerbyGo();
public DerbyGo()
{
    new string[100];
    format(string, sizeof(string), "DERBY: The destruction derby has started with %d players.", DerbyPlayers);
    SendClientMessageToAll(COLOR_WHITE, string);
    foreach(Player, i)
    {
        format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~n~~n~~n~~r~Leader: ~w~%s", Name(i));
        GameTextForPlayer(i, string, 20534053546534, 3);
    }
    return 1;
}
Reply
#2

I think that you should use foreach for each player, and check who has the most HP on their car, then get their name and use it in that string.
Btw i think you must make the gametextforplayer like 5 seconds long, beacuse i doubt that they update, they just stay the same i believe.
Reply
#3

Use a loop and two variables. One variable containing the highest health, and one containing the 'winner'. How will you handle two players having the same health though?
Reply
#4

I am guessing i'll have to let them both win.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)