Freeze car instead of blowing up... Help plx.
#1

Hey, I've made this:

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;
}
This is set to a timer on 10 milliseconds. But the car wont freeze when the Carhealth goes below 280...

Help please? =)
Reply
#2

Try
pawn Код:
if(!IsPlayerInAnyVehicle(i))
    {
instead of
pawn Код:
if(IsPlayerInAnyVehicle(i))
    {
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)