25.08.2009, 11:43
Код:
new IsCarDamaged(vehid);
new CarCrashed(i);
public VehicleHealthTimer()
{
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(IsPlayerInAnyVehicle(i))
{
GetVehicleHealth(GetPlayerVehicleID(i),vhealth[i]);
if(vhealth[i] < 280)
{
vehid = (GetPlayerVehicleID(i));
CarCrashed(i) = 1;
TogglePlayerControllable(i, 0);
SendClientMessage(i,0xFFFFFF96,"|________________________________________Car________________________________________|");
SendClientMessage(i,0x0000FF96,"You can't drive this car anymore the engine is damage!");
SendClientMessage(i,0x0000FF96,"Call 911 and call for Medic or the Police (you must RP your car crash)");
}
}
}
}
public OnPlayerStateChange(playerid)
{
if CarCrashed = 1
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_YELLOW, "Your car is damaged and not driveable");
}
return 1
}

