DestroyVehicle
#1

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 Код:
new Car[MAX_PLAYERS];
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
Reply
#2

There isn't 'killerid' in OnVehicleDeath params


You wanted to do this?
pawn Код:
public OnPlayerDeath(...)
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        DestroyVehicle(GetPlayerVehicleID(playerid));
    }
    return 1;
}
Reply
#3

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
Reply
#4

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;
}
Reply
#5

I done it. .YEAHHHHHH....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)