/Destroycars
#2

pawn Код:
if(strcmp(cmd, "/destroycars", true) == 0)
{
    if(IsPlayerConnected(playerid)) //it's lol, but, it's you code, so...
    {
        if(PlayerInfo[playerid][pAdmin] < 4)
        {
            SendClientMessage(playerid, COLOR_GRAD1, "  you are not authorized to use that command!");
            return 1;
        }
        for(new i = 0; i < sizeof(CreatedCars); i++)
        {
            if(CreatedCars[i] != 0) //if vehicleid is valid, unnecessary... if 0, DestroyVehicle will fail
            {
                DestroyVehicle(CreatedCars[i]); //it's the vehicleid stored in CreatedCars, not "i".
                CreatedCars[i] = 0; //no more vehicleid stored
            }
        }
        SendClientMessage(playerid, COLOR_GREY, "  Created Vehicles destroyed !");
    }
    return 1;
}
Reply


Messages In This Thread
/Destroycars - by Lia - 25.09.2009, 00:10
Re: /Destroycars - by Toribio - 25.09.2009, 03:36

Forum Jump:


Users browsing this thread: 1 Guest(s)