18.12.2012, 15:29
Hy guys, i wonna to make for my RP server vhen two vehicles get crashed to vehicles engine stop working...So what i need to add if wehicle take damage about 50 hp to engine stop working...
forward carhealthcheck();
public carhealthcheck()
{
new Float:vhp;
for(new vehicleid; vehicleid<MAX_VEHICLES;vehicleid++)
{
if(GetVehicleModel(vehicleid)==0)continue;
GetVehicleHealth(vehicleid,vhp);
if(vhp<500.0)
{
SetVehicleHealth(vehicleid,350)
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid,0,lights,alarm,doors,bonnet,boot,objective);
}
}
}
This is what i found after 20 second of googling
Use a timer that repeats by the way, pawn Код:
|