SA-MP Forums Archive
Help with destroycdveh - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with destroycdveh (/showthread.php?tid=443427)



Help with destroycdveh - Grooty - 12.06.2013

Here's the code...
Код:
CMD:destroycdveh(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin] < 1337)
	{
        SendClientMessageEx(playerid, COLOR_GREY, " You are not allowed to use this command.");
        return 1;
    }

    new string[128], vehid;
    if(sscanf(params, "d", vehid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /destroycdveh [vehicleid]");

    DestroyCarDealershipVehicle(GetCarDealershipId(vehid), GetCarDealershipVehicleId(vehid));
    SavecDealership(GetCarDealershipId(vehid));
    format(string, sizeof(string), " SYSTEM: Car dealership vehicle destroyed (ID %d)", vehid);
    SendClientMessageEx(playerid, COLOR_GRAD1, string);
    return 1;
}

When I do it, it just says the string but it doesn't actually delete the car.


Re: Help with destroycdveh - RALL0 - 12.06.2013

Try this
pawn Код:
new carid = GetCarDealershipVehicleId(vehid);
new dealerid = GetCarDealershipId(vehid);
DestroyCarDealershipVehicle(dealerid, carid);



Re: Help with destroycdveh - Grooty - 12.06.2013

Quote:
Originally Posted by RALL0
Посмотреть сообщение
Try this
pawn Код:
new carid = GetCarDealershipVehicleId(vehid);
new dealerid = GetCarDealershipId(vehid);
DestroyCarDealershipVehicle(dealerid, carid);
Didn't work; same thing occurs.