21.02.2019, 17:55
Haven't you tried doing this?:
PHP код:
CMD:sellgarage(playerid, params[])
{
new GarageID, price;
if(sscanf(params, "ii", GarageID, price)) return SCM(playerid, COLOR_BELGREEN, "» [USAGE]: /sellgarage [Garage ID] [Price]");
if(!GarageInfo[GarageID][garageExists]) return SCM(playerid, COLOR_ERROR, "» You have specified an invalid garage ID.");
if(price < 0 || price > 999999) return SCM(playerid, COLOR_ERROR, "» Invalid price.");
if(DoesPlayerOwnsGarage(playerid, GarageID) == 0) return SCM(playerid, COLOR_ERROR, "» You are not the owner of this garage.");
GarageInfo[GarageID][SellPlayerPrice] = price;
Garage_Update(GarageID);
SCMEX(playerid, COLOR_YELLOW, "» [GARAGE] Your garage has been put for sale for $%d!", price);
SCMTAEX(COLOR_YELLOW, "» [GARAGE] %s (%d) is selling their garage for $%d", ReturnPlayerName(playerid), playerid, price);
return 1;
}