Скрипт изменяет управление вертолетов. От урона они становится слегка не управляемыми. На пол секунды глохнут. При большом уроне вертолеты заглохнут.
forward ChopperStat(playerid);
new ChopperTimer[MAX_PLAYERS];
new glchop[MAX_PLAYERS];
new optchop[MAX_PLAYERS];
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new aviainfo = GetVehicleModel(GetPlayerVehicleID(playerid));
switch(aviainfo){case 400..416,418..424,426..446,448..468,470..486,489..496,498..547,549..562,564..612: return 1;}
ChopperTimer[playerid] = SetTimerEx("ChopperStat",0, true, "i", playerid);
glchop[playerid] = 0,
optchop[playerid] = 0;
return 1;
}
if(newstate == PLAYER_STATE_ONFOOT)
{
KillTimer(ChopperTimer[playerid]);
glchop[playerid] = 0;
optchop[playerid] = 0;
return 1;
}
return 1;
}
public ChopperStat(playerid)
{
new aviainfo = GetVehicleModel(GetPlayerVehicleID(playerid));
switch(aviainfo){case 400..416,418..424,426..446,448..468,470..486,489..496,498..547,549..562,564..612: return 1;}
new v = GetPlayerVehicleID(playerid);
new Float:h;
GetVehicleHealth(v,h);
optchop[playerid] += 1;
if(optchop[playerid] == 1) if(h > 650)
{
SetVehicleParamsEx(GetPlayerVehicleID(playerid),1,0,0,0,0,0,0);
glchop[playerid] = 0;
}
if(h > 301 && h < 650)
{
glchop[playerid] += 1;
if(glchop[playerid] == 50) SetVehicleParamsEx(GetPlayerVehicleID(playerid),1,0,0,0,0,0,0);
if(glchop[playerid] == h)
{
SetVehicleParamsEx(GetPlayerVehicleID(playerid),0,0,0,0,0,0,0);
glchop[playerid] = 0;
optchop[playerid] = 0;
}
}
if(h > 0 && h < 300)
{
SetVehicleParamsEx(GetPlayerVehicleID(playerid),0,0,0,0,0,0,0);
glchop[playerid] = 0;
optchop[playerid] = 0;
}
return 1;
}