vehcile blowing up - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: vehcile blowing up (
/showthread.php?tid=269943)
vehcile blowing up -
bally1989 - 18.07.2011
when a vehicle has reached its damaged limit, and then sets on fire .
what i want to no is how do i stop it from blowing up and killing player , i would like it so when its at damage limit it just turns off and engine wont run until vehicle is repaired , its for trucking server so dont want everyones vehicles blowing up so they cant finish there mission, and i am using assistance script so if no cars break down =no jobs for assistance
all help apreciated
Re: vehcile blowing up -
Wesley221 - 18.07.2011
pawn Код:
SetTimer("CarWrecked", 1000, true);
forward CarWrecked();
public CarWrecked()
{
for(new i; i < MAX_PLAYERS; i++)
{
new Float:VehHealth;
new PlayerVehicle;
PlayerVehicle = GetPlayerVehicleID(i);
GetVehicleHealth(PlayerVehicle, VehHealth);
if(IsPlayerInAnyVehicle(i))
{
if( VehHealth < 350 )
{
SetVehicleHealth(i, 350);
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(PlayerVehicle,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(PlayerVehicle,0,lights,alarm,doors,bonnet,boot,objective);
}
}
}
return 1;
}
Maybe something like this. Not sure if it gives errors, if its gonna work: tell me if not