I need script (Rep +)
#6

I've got that:
pawn Код:
public OnVehicleDamageStatusUpdate(vehicleid, playerid) //Get called every time a vehicle health changes (I think)
{
    new Float:health; //Creating a variable for the car's health
   
    GetVehicleHealth(vehicleid,health); //Storing the actual health of the vehicle in the variable
    if(health < 250.0) //Checkin if the health is lower than 400.0 (1000.0 is the max, somewhere around 400.0, it catches fire)
    {
        new engine, lights, alarm, doors, bonnet, boot, objective; //Creating variable's for the vehicle's parameters (doors, bonnet, engine, etc)
        GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective); //Getting the vehicle's parameters)
        SetVehicleParamsEx(vehicleid, 0, 0, 0, doors, bonnet, boot, objective); //Turning off the engine
        SetVehicleHealth(vehicleid,251.0);
        SendClientMessage(playerid, 0xFF0000FF, "Your car is broken.");
        return 1;
    }
    return 1;
}
But it works only sometimes (not always when health goes under 250)
Reply


Messages In This Thread
I need script (Rep +) - by xGoldenx - 12.12.2011, 16:55
Re: I need script (Rep +) - by English-Conceptz - 12.12.2011, 17:07
Re: I need script (Rep +) - by Speed - 12.12.2011, 17:08
Re: I need script (Rep +) - by xGoldenx - 12.12.2011, 17:52
Re: I need script (Rep +) - by English-Conceptz - 12.12.2011, 18:02
Re: I need script (Rep +) - by xGoldenx - 13.12.2011, 18:19
Re: I need script (Rep +) - by Rob_Maate - 13.12.2011, 20:46
Re: I need script (Rep +) - by xGoldenx - 15.12.2011, 18:52
Re: I need script (Rep +) - by Kostas' - 15.12.2011, 19:15
Re: I need script (Rep +) - by xGoldenx - 15.12.2011, 19:21
AW: I need script (Rep +) - by BigETI - 15.12.2011, 20:01
Re: I need script (Rep +) - by Rob_Maate - 15.12.2011, 20:28
Re: I need script (Rep +) - by Kostas' - 16.12.2011, 12:26
Re: I need script (Rep +) - by xGoldenx - 16.12.2011, 14:48
Re: I need script (Rep +) - by xGoldenx - 16.12.2011, 20:38

Forum Jump:


Users browsing this thread: 2 Guest(s)