02.12.2011, 23:22
hi,
how to detect the name of the player that is driving the vehicle with the most health?
This code does not work...
how to detect the name of the player that is driving the vehicle with the most health?
This code does not work...
pawn Код:
forward Detector(playerid);
public Detector(playerid)
{
foreach(Player,i)
{
new Float:MostHealth, Float:vHealth, vDriver, veh;
for(new c = 0; c < MAX_VEHICLES; c++)
{
GetVehicleHealth(c, vHealth);
if(vHealth > MostHealth)
{
MostHealth = vHealth;
veh = c;
}
}
vDriver = GetVehicleDriver(veh);
new name[24];
GetPlayerName(vDriver,name,24);
}
return 1;
}