Wierd attached objects bug.
#1

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:
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;
}
I can't tell what's the problem is, code has no warnings / errors.
But why does it destroys wrong vehicle's objects?
Reply
#2

Seems i've fixed it.
I had shipid = 0; under OnGameModeInit which caused game to mess up ids...
Now it seems when i moved it to top it works fine...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)