Hallo Community,
Und zwar habe ich folgendes Problem, immer wenn ich ein haus oder ein biz kaufe speichert dieser nicht ab wenn ich alles neu starte. Woran kann dies liegen? Die datenbank ist vorhanden
ich habe mal nach gekuckt und alles sollt eig richtig sein. Kann mir einer weiter helfen?
public LoadProperty()
{
new string[128];
for(new i = 0; i < sizeof(HouseInfo); i++)
{
format(string, sizeof(string),"SELECT * FROM `houses` WHERE `HouseID` = '%d'", i);
self_mysql_queryEx(string);
mysql_store_result(MySQLConnection);
if(mysql_num_rows(MySQLConnection) != 0)
{
mysql_fetch_row_format(string);
new val[ 256 ];
self_mysql_get_field("Owner", val); strmid(HouseInfo[i][hOwner], val, 0, strlen(val), 255);
self_mysql_get_field("Beschreibung", val); strmid(HouseInfo[i][hBeschreibung], val, 0, strlen(val), 255);
self_mysql_get_field("Preis", val); HouseInfo[i][hPreis] = strval( val );
self_mysql_get_field("HealUpgrade", val); HouseInfo[i][hHealUpgrade] = strval( val );
self_mysql_get_field("ArmorUpgrade", val); HouseInfo[i][hArmorUpgrade] = strval( val );
self_mysql_get_field("Lock", val); HouseInfo[i][hLock] = strval( val );
self_mysql_get_field("Owned", val); HouseInfo[i][hOwned] = strval( val );
self_mysql_get_field("Rooms", val); HouseInfo[i][hRooms] = strval( val );
self_mysql_get_field("Rent", val); HouseInfo[i][hRent] = strval( val );
self_mysql_get_field("Rentabil", val); HouseInfo[i][hRentabil] = strval( val );
self_mysql_get_field("Kasse", val); HouseInfo[i][hKasse] = strval( val );
//self_mysql_get_field("Date", val); HouseInfo[i][hDate] = strval( val );
self_mysql_get_field("Level", val); HouseInfo[i][hLevel] = strval( val );
self_mysql_get_field("MedickitUpgradeTime", val); HouseInfo[i][hMedickitUpgradeTime] = strval( val );
}
mysql_free_result(MySQLConnection);
}
return 1;
}
public LoadBiz()
{
new string[128];
for(new i = 0; i < sizeof(BizInfo); i++)
{
format(string, sizeof(string),"SELECT * FROM `biz` WHERE `BizID` = '%d'", i);
self_mysql_queryEx(string);
mysql_store_result(MySQLConnection);
if(mysql_num_rows(MySQLConnection) != 0)
{
mysql_fetch_row_format(string);
new val[ 256 ];
self_mysql_get_field("Owned", val); BizInfo[i][bOwned] = strval( val );
self_mysql_get_field("Owner", val); strmid(BizInfo[i][bOwner], val, 0, strlen(val), 255);
self_mysql_get_field("Message", val); strmid(BizInfo[i][bMessage], val, 0, strlen(val), 255);
self_mysql_get_field("Extortion", val); strmid(BizInfo[i][bExtortion], val, 0, strlen(val), 255);
self_mysql_get_field("LevelNeeded", val); BizInfo[i][bLevelNeeded] = strval( val );
self_mysql_get_field("BuyPrice", val); BizInfo[i][bBuyPrice] = strval( val );
self_mysql_get_field("EntranceCost", val); BizInfo[i][bEntranceCost] = strval( val );
self_mysql_get_field("Till", val); BizInfo[i][bTill] = strval( val );
self_mysql_get_field("Locked", val); BizInfo[i][bLocked] = strval( val );
self_mysql_get_field("Products", val); BizInfo[i][bProducts] = strval( val );
self_mysql_get_field("MaxProducts", val); BizInfo[i][bMaxProducts] = strval( val );
self_mysql_get_field("PriceProd", val); BizInfo[i][bPriceProd] = strval( val );
}
mysql_free_result(MySQLConnection);
}
return 1;
}
public LoadSBiz()
{
for(new i = 0; i < sizeof(SBizInfo); i++)
{
new string[256];
format(string, sizeof(string),"SELECT * FROM `sbiz` WHERE `SBizID` = '%d'", i);
self_mysql_queryEx(string);
mysql_store_result(MySQLConnection);
if(mysql_num_rows(MySQLConnection) != 0)
{
mysql_fetch_row_format(string);
new val[ 256 ];
self_mysql_get_field("Owned", val); SBizInfo[i][sbOwned] = strval( val );
self_mysql_get_field("Owner", val); strmid(SBizInfo[i][sbOwner], val, 0, strlen(val), 255);
self_mysql_get_field("Message", val); strmid(SBizInfo[i][sbMessage], val, 0, strlen(val), 255);
self_mysql_get_field("Extortion", val); strmid(SBizInfo[i][sbExtortion], val, 0, strlen(val), 255);
self_mysql_get_field("LevelNeeded", val); SBizInfo[i][sbLevelNeeded] = strval( val );
self_mysql_get_field("BuyPrice", val); SBizInfo[i][sbBuyPrice] = strval( val );
self_mysql_get_field("EntranceCost", val); SBizInfo[i][sbEntranceCost] = strval( val );
self_mysql_get_field("Till", val); SBizInfo[i][sbTill] = strval( val );
self_mysql_get_field("Locked", val); SBizInfo[i][sbLocked] = strval( val );
self_mysql_get_field("Products", val); SBizInfo[i][sbProducts] = strval( val );
self_mysql_get_field("MaxProducts", val); SBizInfo[i][sbMaxProducts] = strval( val );
self_mysql_get_field("PriceProd", val); SBizInfo[i][sbPriceProd] = strval( val );
}
mysql_free_result(MySQLConnection);
}
return 1;
}
public LoadTankenBiz()
{
new string[128];
for(new i = 1; i < sizeof(TankenBizInfo); i++)
{
format(string, sizeof(string),"SELECT * FROM `tankenbiz` WHERE `TankenBizID` = '%d'", i);
self_mysql_queryEx(string);
mysql_store_result(MySQLConnection);
if(mysql_num_rows(MySQLConnection) != 0)
{
mysql_fetch_row_format(string);
new val[ 256 ];
self_mysql_get_field("Owned", val); TankenBizInfo[i][TBOwned] = strval( val );
self_mysql_get_field("Owner", val); strmid(TankenBizInfo[i][TBOwner], val, 0, strlen(val), 255);
self_mysql_get_field("Message", val); strmid(TankenBizInfo[i][TBMessage], val, 0, strlen(val), 255);
self_mysql_get_field("Extortion", val); strmid(TankenBizInfo[i][TBExtortion], val, 0, strlen(val), 255);
self_mysql_get_field("LevelNeeded", val); TankenBizInfo[i][TBLevelNeeded] = strval( val );
self_mysql_get_field("KaufPreis", val); TankenBizInfo[i][TBKaufPreis] = strval( val );
self_mysql_get_field("Spritpreis", val); TankenBizInfo[i][TBSpritPreis] = strval( val );
self_mysql_get_field("Kasse", val); TankenBizInfo[i][TBKasse] = strval( val );
self_mysql_get_field("Locked", val); TankenBizInfo[i][TBLocked] = strval( val );
self_mysql_get_field("Products", val); TankenBizInfo[i][TBProducts] = strval( val );
self_mysql_get_field("MaxProducts", val); TankenBizInfo[i][TBMaxProducts] = strval( val );
self_mysql_get_field("ProdPreis", val); TankenBizInfo[i][TBProdPreis] = strval( val );
}
mysql_free_result(MySQLConnection);
printf("Eigentümer:%s Name:%s Spritpreis:%d Kasse:%d Produkte:%d/%d",
TankenBizInfo[i][TBOwner],
TankenBizInfo[i][TBMessage],
TankenBizInfo[i][TBSpritPreis],
TankenBizInfo[i][TBKasse],
TankenBizInfo[i][TBProducts],
TankenBizInfo[i][TBMaxProducts]);
print("Tanken laden");
}
return 1;
}