how destroy cars? +rep
#1

hi,

i cant destroy the cars i spawned with createvehicle.
Wheres the bug?
They just arent destroyed...

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
    Vehicle[i]=CreateVehicle(VehicleID,CarPos1[i][0],CarPos1[i][1],CarPos1[i][2],CarPos1[i][4],-1,-1,20);
}

public OnVehicleDeath(vehicleid, killerid)
{
    DestroyVehicle(RWVehicle[vehicleid]);
    return 1;
}

foreach(Player,i)DestroyVehicle(RWVehicle[i]);
Reply
#2

You created the new RWVehicle?
Reply
#3

pawn Код:
public OnVehicleDeath(vehicleid, killerid )
{
foreach(player, i )
{
DestroyVehicle(Vehicle[i]);
}
return 1;
}
Not tested. In a hurry. Its 4 : 55 AM and i haven't slept 0,0.
Reply
#4

thx so far but the main question has not been answered yet...
How could i destroy all the vehicles stored in the array RWVehicle[MAX_PLAYERS] using a loop?
Reply
#5

I didn't test this, I'm not home right now:
pawn Код:
for(new v = 0; v < sizeof(RWVehicle); v++)
{
    DestroyVehicle(RWVehicle[v]);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)