stock afixhs(playerid)
{
new asname[MAX_PLAYER_NAME];
GetPlayerName(playerid,asname, sizeof(asname));
new str1[256],str[256];
format(str, sizeof(str), "ladmin/users/%s.sav", udb_encode(asname));
new housenumber = dini_Int(str, "hID");
format(str1, sizeof(str1), "SATDM/houses/%d", housenumber);//"%d" is the house id
dini_Set(str1, "Owner", asname);
HouseInfo[housenumber][Owner]=asname;
DestroyDynamicPickup(HousePickup[housenumber]);
HousePickup[housenumber] = CreateDynamicPickup(1273, 23, HouseInfo[housenumber][iconx], HouseInfo[housenumber][icony], HouseInfo[housenumber][iconz]);
new hnowner[30];
format(hnowner,128,"%s",HouseInfo[housenumber][Owner]);
if(strcmp(HouseInfo[housenumber][Owner],DEFAULT_OWNER,false) == 0) {
format(hnowner,128,"Not Owned");
}
UpdateDynamic3DTextLabelText(hTextInfo[housenumber],0xFF0000FF,hnowner);
DestroyDynamicMapIcon(housemapicon[housenumber]);
housemapicon[housenumber] = CreateDynamicMapIcon(HouseInfo[housenumber][iconx], HouseInfo[housenumber][icony], HouseInfo[housenumber][iconz],32,c_y);
}
stock afixhs(playerid)
{
new asname[MAX_PLAYER_NAME], Query[250], Query1[250];
GetPlayerName(playerid,asname, sizeof(asname));
mysql_format(mysql, Query, sizeof Query, "SELECT * FROM `accounts` WHERE `Name` = '%s'", asname);
new rows, fields, housenumber;
cache_get_data(rows, fields, mysql);
housenumber = cache_get_field_content_int(0, "hID", mysql);//'hID' is the house id in 'accounts' table
mysql_format(mysql, Query1, sizeof Query1, "UPDATE `houses` SET `Owner` = '%s' WHERE `ID` = '%d'", asname, housenumber);//'%d' is the house id in 'houses' table
mysql_tquery(mysql, Query1, "", "");
HouseInfo[housenumber][Owner]=asname;//<<<<<<<<<<<<<<<<<<Line 49010
DestroyDynamicPickup(HousePickup[housenumber]);
HousePickup[housenumber] = CreateDynamicPickup(1273, 23, HouseInfo[housenumber][HX], HouseInfo[housenumber][HY], HouseInfo[housenumber][HZ]);
new hnowner[30];
format(hnowner,128,"%s",HouseInfo[housenumber][Owner]);
if(strcmp(HouseInfo[housenumber][Owner],DEFAULT_OWNER,false) == 0) {
format(hnowner,128,"Not Owned");
}
UpdateDynamic3DTextLabelText(hTextInfo[housenumber],0xFF0000FF,hnowner);
DestroyDynamicMapIcon(housemapicon[housenumber]);
housemapicon[housenumber] = CreateDynamicMapIcon(HouseInfo[housenumber][HX], HouseInfo[housenumber][HY], HouseInfo[housenumber][HZ],32,c_y);
}
(49012) : error 047: array sizes do not match, or destination array is too small
format(HouseInfo[housenumber][Owner], MAX_PLAYER_NAME, "%s", aname); Or, strcat(HouseInfo[housenumber][Owner], aname, MAX_PLAYER_NAME);
1> Inside mysql_tquery, mention a function name and use threaded query.
2> You can not copy strings like that. Use format or strcat. EG: Code:
format(HouseInfo[housenumber][Owner], MAX_PLAYER_NAME, "%s", aname); Or, strcat(HouseInfo[housenumber][Owner], aname, MAX_PLAYER_NAME); |
new myArray[] = "Hello world!", otherArray[] = "Hello other world!";
otherArray = myArray;
//Now both arrays will print "Hello world!"