error 047: array sizes do not match, or destination array is too small -
Danijel. - 23.06.2012
error 047: array sizes do not match, or destination array is too small
Код:
stock CreateHouse(cijena, Float:X, Float:Y, Float:Z, Float:kIntX, Float:kIntY, Float:kIntZ, adresa[], intid, vrsta[])
{
new tipkuce[32];
new adresakuce[32];
CreateHouse(cijenakuce, pX, pY, pZ, 2324.419921,-1145.568359,1050.710083, adresakuce, 12, tipkuce[]); {
new Query[128], i;
new DBResult:qresult;
qresult = db_query(Database,"SELECT * FROM `HOUSES`");
format(Query,sizeof(Query),"%d", db_num_rows(qresult));
HouseInfo[i][ID] = i+1;
HouseInfo[i][VrstaKuce] = vrsta;
HouseInfo[i][Cijena] = cijena;
HouseInfo[i][Adresa] = adresa;
HouseInfo[i][kX] = X;
HouseInfo[i][kY] = Y;
HouseInfo[i][kZ] = Z;
HouseInfo[i][IntX] = kIntX;
HouseInfo[i][IntY] = kIntY;
HouseInfo[i][IntZ] = kIntZ;
db_free_result(qresult);
format(Query, sizeof(Query), "INSERT INTO `HOUSES` ( 'ID', 'VLASNIK', 'CIJENA', ADRESA', 'X', 'Y', 'Z', 'INZX', 'INTY', 'INTZ', 'MATS', 'DROGA', 'NOVAC', 'BRAVA') VALUES('%s','%s')", DB_Escape(HouseInfo[i][ID]), 0);
db_query(Database, Query);
format(Query, sizeof(Query), "UPDATE `HOUSES` SET VLASNIK = '0', CIJENA = '%d', ADRESA = '%s', X = '%f', Y = '%f', Z = '%f' WHERE `ID` = '%d' ", HouseInfo[i][Cijena], HouseInfo[i][Adresa], HouseInfo[i][kX], HouseInfo[i][kY], HouseInfo[i][kZ], HouseInfo[i][ID]);
db_query(Database, Query);
format(Query, sizeof(Query), "UPDATE `HOUSES` SET INTX = '%f', INTY = '%f', INTZ = '%f', MATS = '%d', DROGA = '%d', NOVAC = '%d', BRAVA = '%d', NAPRODAJU = '1', VRSTAKUCE = '%s' WHERE `ID` = '%d' ", HouseInfo[i][IntX], HouseInfo[i][IntY], HouseInfo[i][IntZ], HouseInfo[i][kMats], HouseInfo[i][kDroga], HouseInfo[i][kNovac], HouseInfo[i][kBrava], HouseInfo[i][ID], HouseInfo[i][VrstaKuce]);
db_query(Database, Query);
format(KucniLabel, sizeof(KucniLabel), ""ZELENA"Kuca na PRODAJU!\nOpis:"BIJELA" %s\n"ZELENA"Adresa: "BIJELA"%s\n"ZELENA"Cijena: "BIJELA"$%i",HouseInfo[i][VrstaKuce],HouseInfo[i][Adresa],HouseInfo[i][Cijena]);
HouseInfo[i][LabelKuce] = Create3DTextLabel(KucniLabel,-1,HouseInfo[i][kX], HouseInfo[i][kY], HouseInfo[i][kZ]+1,30.0,0,1);
return 1;}
Errors:
Код:
C:\Users\David\Desktop\BLRP\gamemodes\BLRP.pwn(3133) : error 047: array sizes do not match, or destination array is too small
C:\Users\David\Desktop\BLRP\gamemodes\BLRP.pwn(3135) : error 047: array sizes do not match, or destination array is too small
Re: error 047: array sizes do not match, or destination array is too small -
Kindred - 23.06.2012
Tell us the lines the errors are on. I don't want to look through all of this (honestly).
Re: error 047: array sizes do not match, or destination array is too small -
Danijel. - 23.06.2012
HouseInfo[i][ID] = i+1;
HouseInfo[i][VrstaKuce] = vrsta; <---- THIS
HouseInfo[i][Cijena] = cijena;
HouseInfo[i][Adresa] = adresa; <------ AND THIS
HouseInfo[i][kX] = X;
HouseInfo[i][kY] = Y;
HouseInfo[i][kZ] = Z;
HouseInfo[i][IntX] = kIntX;
HouseInfo[i][IntY] = kIntY;
HouseInfo[i][IntZ] = kIntZ;
db_free_result(qresult);
Re: error 047: array sizes do not match, or destination array is too small -
Kindred - 23.06.2012
Considering it looks like the variable stores a string, is the variable actually a string?
pawn Код:
enum hInfo
{
Cijena[stringsize],
Adresa[stringsize]
}
HouseInfo[MAX_HOUSES][hInfo];
Like this?
Not sure if that is a string, because I don't know what language this is and I don't know what the variable says.
Re: error 047: array sizes do not match, or destination array is too small -
Danijel. - 23.06.2012
It is like that and variables says Type(like house type) and address