11.12.2010, 17:20
How to spawn vehicles that are damaged? which has black smoke coming from bunet and the bunnets are crushed(front of car)
public OnVehicleSpawn(vehicleid)
SetVehicleHealth(vehicleid, health);
UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
AddStaticVehicle(415, -1551, 727, 7, 259.99694824219, 6, 0); //Cheetah
AddStaticVehicle(402, -1548, 727, 7, 45.999755859375, 79, 0); //Victon
//At the top of your script new DamagedCheetah; new DamagedVicton;
//Under OnGameModeInit() DamagedCheetah = CreateVehicle(415, -1551, 727, 7, 259.99694824219, 6, 0, 1); DamagedVicton = CreateVehicle(402, -1548, 727, 7, 45.999755859375, 79, 0, 1);
//Under OnVehicleSpawn(vehicleid) if(vehicleid==DamagedCheetah || vehicleid==DamagedVicton) { SetVehicleHealth(vehicleid, 120.0);//Change it to the amount you wish to have ;) new panels,doors,lights,tires,engine,lights2,alarm,doors2,bonnet,boot,objective; GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires); GetVehicleParamsEx(vehicleid,engine,lights2,alarm,doors2,bonnet,boot,objective); UpdateVehicleDamageStatus(vehicleid, 4, 6, 3, 10);//Change it if you want to . SetVehicleParamsEx(vehicleid,engine,lights2,alarm,doors2,1,boot,objective); }
C:\Documents and Settings\Abraham2\Desktop\Abe\filterscripts\ACCIDENT.pwn(69) : warning 202: number of arguments does not match definition C:\Documents and Settings\Abraham2\Desktop\Abe\filterscripts\ACCIDENT.pwn(70) : warning 202: number of arguments does not match definition C:\Documents and Settings\Abraham2\Desktop\Abe\filterscripts\ACCIDENT.pwn(84) : error 017: undefined symbol "GetVehicleDamageStatus" C:\Documents and Settings\Abraham2\Desktop\Abe\filterscripts\ACCIDENT.pwn(85) : error 017: undefined symbol "GetVehicleParamsEx" C:\Documents and Settings\Abraham2\Desktop\Abe\filterscripts\ACCIDENT.pwn(86) : error 017: undefined symbol "UpdateVehicleDamageStatus" C:\Documents and Settings\Abraham2\Desktop\Abe\filterscripts\ACCIDENT.pwn(87) : error 017: undefined symbol "SetVehicleParamsEx" C:\Documents and Settings\Abraham2\Desktop\Abe\filterscripts\ACCIDENT.pwn(83) : warning 203: symbol is never used: "objective" C:\Documents and Settings\Abraham2\Desktop\Abe\filterscripts\ACCIDENT.pwn(83) : warning 203: symbol is never used: "boot" C:\Documents and Settings\Abraham2\Desktop\Abe\filterscripts\ACCIDENT.pwn(83) : warning 203: symbol is never used: "bonnet" C:\Documents and Settings\Abraham2\Desktop\Abe\filterscripts\ACCIDENT.pwn(83) : warning 203: symbol is never used: "doors2" C:\Documents and Settings\Abraham2\Desktop\Abe\filterscripts\ACCIDENT.pwn(83) : warning 203: symbol is never used: "alarm" C:\Documents and Settings\Abraham2\Desktop\Abe\filterscripts\ACCIDENT.pwn(83) : warning 203: symbol is never used: "lights2" C:\Documents and Settings\Abraham2\Desktop\Abe\filterscripts\ACCIDENT.pwn(83) : warning 203: symbol is never used: "engine" C:\Documents and Settings\Abraham2\Desktop\Abe\filterscripts\ACCIDENT.pwn(83) : warning 203: symbol is never used: "tires" C:\Documents and Settings\Abraham2\Desktop\Abe\filterscripts\ACCIDENT.pwn(83) : warning 203: symbol is never used: "lights" C:\Documents and Settings\Abraham2\Desktop\Abe\filterscripts\ACCIDENT.pwn(83) : warning 203: symbol is never used: "doors" C:\Documents and Settings\Abraham2\Desktop\Abe\filterscripts\ACCIDENT.pwn(83) : warning 203: symbol is never used: "pannels" C:\Documents and Settings\Abraham2\Desktop\Abe\filterscripts\ACCIDENT.pwn(83 -- 89) : error 001: expected token: "#endif", but found "-end of file-" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors.
//On Top:
new DamagedCheetah;
new DamagedVictom;
//under public OnFilterScriptInit
DamagedCheetah = CreateVehicle(415, -1551, 727, 7, 259.99694824219, 6, 0); //Cheetah
DamagedVictom = CreateVehicle(402, -1548, 727, 7, 45.999755859375, 79, 0); //Victom
//Under public OnVehicleSpawn(vehicleid)
if(vehicleid==DamagedCheetah || vehicleid==DamagedVictom)
{
SetVehicleHealth(vehicleid, 120.0); //Change This to the amount you wish to have.
new pannels,doors,lights,tires,engine,lights2,alarm,doors2,bonnet,boot,objective;
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
GetVehicleParamsEx(vehicleid,engine,lights2,alarm,doors2,bonnet,boot,objective);
UpdateVehicleDamageStatus(vehicleid, 4, 6, 3, 10);//Change it if you want to .
SetVehicleParamsEx(vehicleid,engine,lights2,alarm,doors2,1,boot,objective);
}