27.02.2019, 10:54
Getting this error on this CMD:
Error line:
#define MAX_GARAGE_NAME 40
pawn Код:
CMD:garagename(playerid, params[])
{
new id = GetClosestGarage(playerid);
if(id == -1) return SCM(playerid, COLOR_ERROR, "» There are no garages near you.");
//if(GarageData[id][garageOwnerID] != playerid) return SCM(playerid, COLOR_ERROR, "» This garage not yours."); //To fix
if(!GarageData[id][garageOwned]) return SCM(playerid, COLOR_ERROR, "» This garage is unowned.");
new name;
if(name < 4 || name > MAX_GARAGE_NAME) return SCM(playerid, COLOR_ERROR, "» Name should be between 4 and 40 chars.");
format(GarageData[id][garageName], MAX_GARAGE_NAME, name);
new Query[150];
format(Query,sizeof(Query), "UPDATE garages SET garageName = '%e' WHERE ID = '%d'", name, id);
db_query(GarageDB, Query);
UpdateGarageLabel(id);
SCM(playerid, COLOR_YELLOW, "» [GARAGE] You have changed your garage name successfully!");
SCMEX(playerid, COLOR_YELLOW, "» [GARAGE] New name: %s", name);
GameTextForPlayer(playerid, "~w~Garage ~g~name changed~w~!", 3000, 3);
return 1;
}
pawn Код:
format(GarageData[id][garageName], MAX_GARAGE_NAME, name);