destroy all
#1

Hello. I am making a barricade system, however when I am going to destroy the barricades, it only destroys the last one.

I know what is wrong, it's because it's only storing the last cade, but I don't know how to fix it. This is my code:

pawn Код:
CMD:cade(playerid, params[])
{
    for(new i;i<MAX_BARRICADES;i++)
    {
        new Float:x, Float:y, Float:z, Float:a;
        GetPlayerPos(playerid, x, y, z);
        GetPlayerFacingAngle(playerid, a);
        cade[i] = CreateObject(981, x, y, z, 0.0, 0.0, a);
        SetPlayerPos(playerid, x, y-1, z);
    }
    return 1;
}

CMD:destroycades(playerid, params[])
{
    for(new i;i<MAX_BARRICADES;i++)
    {
        DestroyObject(cade[i]);
    }
    return 1;
}
Reply


Messages In This Thread
destroy all - by Why - 23.09.2012, 13:18
Re: destroy all - by clarencecuzz - 23.09.2012, 13:24
Re: destroy all - by Why - 23.09.2012, 13:25

Forum Jump:


Users browsing this thread: 1 Guest(s)