How to set this into /destroyallcades?
#4

Quote:
Originally Posted by ChristianIvann09
Посмотреть сообщение
Can you make me a statement if there is any barricade?
Hmm no, because i can't see how Barricade[] is defined, perhaps you can count how many objects were deleted, by checking if the object is valid, like this:
pawn Код:
new x = 0;
for(new i; i<MAX_BARRICADES; i++)
{
    if(IsValidDynamicObject(Barricade[i]))
    {
        DestroyDynamicObject(Barricade[i]);
        x++;
    }
}
if(x > 0)
{
        foreach(Player, x)
        {
            if(IsACop(x))
            {
                SendClientMessage(x, TEAM_BLUE_COLOR, string);
            }
        }

}
else
{
    SendClientMessage(playerid, COLOR_GREY, "There is no barricade to destroy!");
}
Not tested yet, hope it works.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)