DestroyVehicle - 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: DestroyVehicle (
/showthread.php?tid=245718)
DestroyVehicle -
marrcko - 01.04.2011
Hi,
I have one problem i want to destroy just few cars with this
pawn Код:
public OnVehicleDeath(vehicleid, killerid)
{
DestroyVehicle(Car[killerid]);
return 1;
}
pawn Код:
Car[playerid] =CreateVehicle(522,x+2,y+2,z+2,0.0,-1,-1,-1);// A lot of lines like this
but this car hadn't destroyed.
But if I write DestroyVehicle(
vehicleid); then all cars will become destroyable( such as AddStaticVehicle(Ex))
So what I should do to make it work right
Re: DestroyVehicle -
Marricio - 01.04.2011
There isn't 'killerid' in OnVehicleDeath params
You wanted to do this?
pawn Код:
public OnPlayerDeath(...)
{
if(IsPlayerInAnyVehicle(playerid))
{
DestroyVehicle(GetPlayerVehicleID(playerid));
}
return 1;
}
Re: DestroyVehicle -
marrcko - 01.04.2011
Nop.. Car shoud be destroyed even player is alive..
I mean then car explode it will destroyed even car has added in GM but i want that only created cars during game will be destroyed
Re: DestroyVehicle -
antonio112 - 01.04.2011
Marricip, actually there is. I know, if you look on samp.wiki there isn`t one ... but in pawno, you can find, this is the exact code from pawno.
pawn Код:
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
Re: DestroyVehicle -
marrcko - 01.04.2011
I done it. .YEAHHHHHH....