14.07.2012, 16:44
Hello, I've been messing around with attached objects... now i am talking about pirate ships...
But when one pirate ship explodes what was caused by button press, other ship which shot loses attached objects.
Code:
I can't tell what's the problem is, code has no warnings / errors.
But why does it destroys wrong vehicle's objects?
But when one pirate ship explodes what was caused by button press, other ship which shot loses attached objects.
Code:
pawn Код:
public OnVehicleDeath(vehicleid, killerid)
{
for(new i = 0; i < MAX_SHIPS; i++)
{
if(vehicleid == piratev[i])
{
new Float:X,Float:Y,Float:Z,Float:RZ;
GetVehiclePos(piratev[i],X,Y,Z);
GetVehicleZAngle(piratev[i],RZ);
for(new O = 0; O < MAX_SHIP_OBJECTS; O++)
{
DestroyDynamicObject(pirateo[piratev[i]][O]);
}
DestroyVehicle(piratev[i]);
}
}
return 1;
}
But why does it destroys wrong vehicle's objects?