10.07.2016, 00:08
Hi how to make this into strcmp?
pawn Код:
dcmd_carsanction(playerid, params[])
{
//if(!IsPlayerPoliceOfficer(playerid)) return SendClientMessage(playerid, COLOR_RED, "[ERROR]You can not use this command"); //Create your own stock which check if is a police officer
if(!IsACop(playerid) && PlayerInfo[playerid][pLeader] != 3 && !(PlayerInfo[playerid][pAdmin] & ADMIN_ACCESS))
return SendClientMessage(playerid, COLOR_GREY, "You are not a law enforcement official.");
new vehicleid = GetVehicleIDNearPlayer(playerid);
if(vehicleid == INVALID_VEHICLE) return SendClientMessage(playerid, COLOR_GREY, "No vehicles found within your range.");
if(VehicleSanctionStats[vehicleid][Sanctioned] == true) return SendClientMessage(playerid, COLOR_GREY, "This vehicle already have a parkingticket");
new sPrice, sReason[128];
if(sscanf(params, "ds[128]", sPrice, sReason)) return SendClientMessage(playerid, COLOR_GRAD2, ""COL_SZR"Usage:"COL_WHITE" /parkingticket [price] [reason]");
VehicleSanctionStats[vehicleid][Sanctioned] = true;
format(VehicleSanctionStats[vehicleid][PTReason], 128, "%s", sReason);
VehicleSanctionStats[vehicleid][PTPrice] = sPrice;
new str[128];
format(str, sizeof(str), "Sanctioned: vID: %d | Price: $%d | Reason: %s", vehicleid, VehicleSanctionStats[vehicleid][PTPrice], VehicleSanctionStats[vehicleid][PTReason]);
SendClientMessage(playerid, 0x6464FF00, str);
format(str, sizeof(str), ""COL_BIZ"Parking Ticket\nPrice: %d\nReason: %s",VehicleSanctionStats[vehicleid][PTPrice], VehicleSanctionStats[vehicleid][PTReason]);
VehicleSanctionStats[vehicleid][sText3d] = Create3DTextLabel(str, COLOR_BIZ, 0.0, 0.0, 0.0, TD_DISTANCE, 0, 0);
Attach3DTextLabelToVehicle(VehicleSanctionStats[vehicleid][sText3d], vehicleid, 0.0, 0.0, 0.0);
return 1;
}