Object won't delete
#1

When I use a command /spikestripdestroy and there's 3-4 spike strips near each other, only the first two are deleted, and the others can't be deleted


pawn Код:
stock DeleteClosestStrip(playerid)
{
    new Float:x,Float:y,Float:z;
    for(new i = 0; i < MAX_STRIPS; i++)
    {
        GetObjectPos(spikestrip[i][0], x, y, z);
        if(IsPlayerInRangeOfPoint(playerid, 2.0, x, y, z))
        {
            if(spikestrip[i][0] != 0)
            {
                DestroyObject(spikestrip[i][0]);
                DestroyPickup(spikestrip[i][1]);
                spikestrip[i][0] = 0; spikestrip[i][1] = 0;
                GameTextForPlayer(playerid, "Spikestrip ~r~destroyed", 3000, 5);
                return 1;
            }
        }
    }
    return 0;
}
Reply


Messages In This Thread
Object won't delete - by Outcast - 08.01.2012, 15:32
Re: Object won't delete - by BlackWolf120 - 08.01.2012, 15:40
Re: Object won't delete - by Outcast - 08.01.2012, 16:08

Forum Jump:


Users browsing this thread: 1 Guest(s)