24.02.2012, 10:27
I tried converting them to DCMD, but the params are still not working. Could you help me?
and
pawn Код:
dcmd_deletedealership(playerid, params[])
{
if(!IsAdmin(playerid, 1)) return SendClientMessage(playerid, COLOR_RED, "You are not admin!");
new dealerid, msg[128];
if(sscanf(params, "d", dealerid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /deletedealership [dealerid]");
if(!IsValidDealership(dealerid)) return SendClientMessage(playerid, COLOR_RED, "Invalid dealerid!");
for(new i=1; i < MAX_DVEHICLES; i++)
{
if(VehicleCreated[i] == VEHICLE_DEALERSHIP && strval(VehicleOwner[i]) == dealerid)
{
DestroyVehicle(VehicleID[i]);
Delete3DTextLabel(VehicleLabel[i]);
VehicleCreated[i] = 0;
}
}
DealershipCreated[dealerid] = 0;
Delete3DTextLabel(DealershipLabel[dealerid]);
SaveDealership(dealerid);
format(msg, sizeof(msg), "Deleted dealership id %d", dealerid);
SendClientMessage(playerid, COLOR_WHITE, msg);
return 1;
}
pawn Код:
dcmd_deletefuelstation(playerid, params[])
{
if(!IsAdmin(playerid, 1)) return SendClientMessage(playerid, COLOR_RED, "You are not admin!");
new stationid, msg[128];
if(sscanf(params, "d", stationid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /deletefuelstation [stationid]");
if(!IsValidFuelStation(stationid)) return SendClientMessage(playerid, COLOR_RED, "Invalid stationid!");
FuelStationCreated[stationid] = 0;
Delete3DTextLabel(FuelStationLabel[stationid]);
SaveFuelStation(stationid);
format(msg, sizeof(msg), "Deleted fuel station id %d", stationid);
SendClientMessage(playerid, COLOR_WHITE, msg);
return 1;
}