18.06.2009, 22:21
Hey, I've made this:
This is set to a timer on 10 milliseconds. But the car wont freeze when the Carhealth goes below 280...
Help please? =)
pawn Код:
new vhealth[MAX_PLAYERS];
public VehicleBroken()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new vehicleid = GetPlayerVehicleID(i);
if(IsPlayerInAnyVehicle(i))
{
GetVehicleHealth(vehicleid,vhealth[i]);
if(vhealth[i] < 280)
{
TogglePlayerControllable(i, 0);
SendClientMessage(i,COLOR_DARKRED,"You can't drive this car anymore the engine is damage! Get a mechanic.");
SendClientMessage(i,COLOR_DARKRED,"/exit to get out of the car");
VehicleInfo[vehicleid][vBroken] = 1;
}
}
}
return 1;
}
Help please? =)