Car remove
#3

This should fix it

Код:
CMD:deletecar(playerid, params[])
{
    new vehid, log[128], dvehid;
	dvehid = GetPlayerVehicleID(playerid);
    if(sscanf(params, "d", vehid))
    {
        if(Dead[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command When You Are Dead.");
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You Must Be In A Vehicle To Use This Command.");
        if(AdminCar[dvehid] == 0) return SendClientMessage(playerid, COLOR_RED, "You Cannot Delete A Static Vehicle. You Can Only Use {FFFF00} /respawncar {FF0000}On It.");
        else if(NormalCar[dvehid] == 0) return SendClientMessage(playerid, COLOR_RED, "You Cannot Delete A Static Vehicle. You Can Only Use {FFFF00} /respawncar {FF0000}On It.");
        format(log, sizeof log, "Admin %s Has Deleted Vehicle ID %d. Model: %d.", PlayerName(playerid), dvehid, GetVehicleModel(dvehid));
        DestroyVehicle(dvehid);
        for(new a = 0; a < sizeof(AttachedObjects[dvehid]); a ++)
        if(AttachedObjects[dvehid][a] != 0)
        DestroyObject(AttachedObjects[dvehid][a]),
        AttachedObjects[dvehid][a] = 0;
        LogToFile("deletecar", log);
        return 1;
    }
    else if(!sscanf(params, "d", vehid))
    {
        if(!IsValidVehicle(vehid)) return SendClientMessage(playerid, COLOR_RED, "This Vehicle Doesn't Exist In The Server.");
        if(AdminCar[vehid] == 0) return SendClientMessage(playerid, COLOR_RED, "You Cannot Delete A Static Vehicle. You Can Only Use {FFFF00} /respawncar {FF0000}On It.");
        else if(NormalCar[vehid] == 0) return SendClientMessage(playerid, COLOR_RED, "You Cannot Delete A Static Vehicle. You Can Only Use {FFFF00} /respawncar {FF0000}On It.");
        format(log, sizeof log, "Admin %s Has Deleted Vehicle ID %d. Model: %d.", PlayerName(playerid), vehid, GetVehicleModel(vehid));
        DestroyVehicle(vehid);
        for(new a = 0; a < sizeof(AttachedObjects[]); a ++)
        if(AttachedObjects[vehid][a] != 0)
        DestroyObject(AttachedObjects[vehid][a]),
        AttachedObjects[vehid][a] = 0;
        LogToFile("deletecar", log);
        return 1;

    }
    return 1;
}
Reply


Messages In This Thread
Car remove - by Ananisiki - 17.05.2014, 09:29
Re: Car remove - by Threshold - 17.05.2014, 09:36
Re: Car remove - by Ciandlah - 17.05.2014, 10:09
Re: Car remove - by Ananisiki - 17.05.2014, 10:21
Re: Car remove - by Ciandlah - 17.05.2014, 11:07
Re: Car remove - by Threshold - 17.05.2014, 11:24
Re: Car remove - by Ananisiki - 17.05.2014, 15:18
Re: Car remove - by Threshold - 18.05.2014, 00:19
Re: Car remove - by Ananisiki - 18.05.2014, 01:20

Forum Jump:


Users browsing this thread: 1 Guest(s)