SA-MP Forums Archive
help me - 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: help me (/showthread.php?tid=198264)



help me - Abraham2nds - 11.12.2010

How to spawn vehicles that are damaged? which has black smoke coming from bunet and the bunnets are crushed(front of car)


Respuesta: help me - RatHack - 11.12.2010

I don't understand u.. u mean, a respawn cmd?


Re: help me - Abraham2nds - 11.12.2010

no im working on a accident map and i want the cars that was hit low on hp so...when filterscipt starts the cars spawn with LOW HP.


Re: help me - hanzen - 11.12.2010

Just use SetVehicleHealth() on them? Set it to something low.

As the Wiki says, it will set on fire when the value is below 250, so maybe around 300?


Re: help me - [MF]FACE - 11.12.2010

Код:
public OnVehicleSpawn(vehicleid)
Put your Code in here
like
Код:
SetVehicleHealth(vehicleid, health);
or
Код:
UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
and maybe you want to open the bonnet, then you'll have to use:

Код:
SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);



Re: help me - WillyP - 11.12.2010

Use GetVehicleHealth, then once respawned, set it to the same damage it was before.


Re: help me - Abraham2nds - 11.12.2010

i dont understand.
i want this to be damaged(BOTH)
pawn Код:
AddStaticVehicle(415, -1551, 727, 7, 259.99694824219, 6, 0); //Cheetah
    AddStaticVehicle(402, -1548, 727, 7, 45.999755859375, 79, 0); //Victon
]


Re: help me - [MF]FACE - 11.12.2010

Код:
//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);
}
Did not tested yet.

I wrote it down immediately


Re: help me - Derksen123 - 11.12.2010

Probably a Respawn Command Without fixing the vehicles?


Re: help me - Abraham2nds - 12.12.2010

I get this error when i use that code
Код:
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.
Heres what i have:
pawn Код:
//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);
    }