21.05.2011, 19:35
here we go (with Stigg's function)
pawn Код:
public OnGameModeInit()
{
SetTimer("CheckAircrafts", 500, true);
return 1;
}
forward CheckAircrafts();
public CheckAircrafts()
{
for(new i=0; i<GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
{
if(IsAFlyingVehicle(GetPlayerVehicleID(playerid)))
{
new Float:hp;
GetVehicleHealth(GetPlayerVehicleID(playerid), hp);
if(hp < 200)
{
YOUR WARN CODE HERE
}
}
}
}
return 1;
}
stock IsAFlyingVehicle(vehicleid)
{
switch(GetVehicleModel(vehicleid))
{
case
460,464,476,511,512,513,519,520,553,577,592,593,//flying vehicle models
417,425,447,465,469,487,488,497,501,548,563:
return true;
}
return false;
}