07.05.2010, 13:58
Just a little example how to do it:
pawn Код:
//somewhere
new Float:max = 0.00;
new winner = -1;
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInDerby[i] == 1)//or whatever you use to know that this player is in derby
{
if(IsPlayerInAnyVehicle(i))
{
new Float:h;
GetVehicleHealth(GetPlayerVehicleID(i),h);
if(h > max)
{
max = h;
winner = i;
}
}
}
}
}
if(winner != -1)
{
new name[MAX_PLAYER_NAME], string[80];
GetPlayerName(winner,name,sizeof(name));
format(string,sizeof(string),"%s's vehicle has the most health and won this round",name);
SendClientMessageToAll(COLOR_WHITE,string);//or whatever color you need
}