Hab mal den Code aus einer alten Version von dem Script rausgekramt, müsste alles mit deinen Sachen passen.
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)
{
format(string, sizeof(string), "INSERT INTO `houses` (`HouseID`) VALUES ('%d')", i);
self_mysql_queryEx(string);
}
mysql_free_result(MySQLConnection);
new var[768];
format(var, sizeof(var), "UPDATE `houses` SET `Owner`='%s', `Beschreibung`='%s', `Preis`='%d', `HealUpgrade`='%d', `ArmorUpgrade`='%d', `Lock`='%d', `Owned`='%d', `Rooms`='%d', `Rent`='%d', `Rentabil`='%d', `Kasse`='%d', `Level`='%d' WHERE `HouseID`='%d'",
HouseInfo[i][hOwner],
HouseInfo[i][hBeschreibung],
HouseInfo[i][hPreis],
HouseInfo[i][hHealUpgrade],
HouseInfo[i][hArmorUpgrade],
HouseInfo[i][hLock],
HouseInfo[i][hOwned],
HouseInfo[i][hRooms],
HouseInfo[i][hRent],
HouseInfo[i][hRentabil],
HouseInfo[i][hKasse],
HouseInfo[i][hLevel],
i);
self_mysql_queryEx(var);
}
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)
{
format(string, sizeof(string), "INSERT INTO `biz` (`BizID`) VALUES ('%d')", i);
self_mysql_queryEx(string);
}
mysql_free_result(MySQLConnection);
new var[768];
format(var, sizeof(var), "UPDATE `biz` SET `Owned`='%d', `Owner`='%s', `Message`='%s', `Extortion`='%s', `LevelNeeded`='%d', `BuyPrice`='%d', `EntranceCost`='%d', `Till`='%d', `Locked`='%d', `Products`='%d', `MaxProducts`='%d', `PriceProd`='%d' WHERE `BizID`='%d'",
BizInfo[i][bOwned],
BizInfo[i][bOwner],
BizInfo[i][bMessage],
BizInfo[i][bExtortion],
BizInfo[i][bLevelNeeded],
BizInfo[i][bBuyPrice],
BizInfo[i][bEntranceCost],
BizInfo[i][bTill],
BizInfo[i][bLocked],
BizInfo[i][bProducts],
BizInfo[i][bMaxProducts],
BizInfo[i][bPriceProd],
i);
self_mysql_queryEx(var);
}
for(new i = 0; i < sizeof(SBizInfo); i++)
{
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)
{
format(string, sizeof(string), "INSERT INTO `sbiz` (`SBizID`) VALUES ('%d')", i);
self_mysql_queryEx(string);
}
mysql_free_result(MySQLConnection);
new var[768];
format(var, sizeof(var), "UPDATE `sbiz` SET `Owned`='%d', `Owner`='%s', `Message`='%s', `Extortion`='%s', `LevelNeeded`='%d', `BuyPrice`='%d', `EntranceCost`='%d', `Till`='%d', `Locked`='%d', `Products`='%d', `MaxProducts`='%d', `PriceProd`='%d' WHERE `SBizID`='%d'",
SBizInfo[i][sbOwned],
SBizInfo[i][sbOwner],
SBizInfo[i][sbMessage],
SBizInfo[i][sbExtortion],
SBizInfo[i][sbLevelNeeded],
SBizInfo[i][sbBuyPrice],
SBizInfo[i][sbEntranceCost],
SBizInfo[i][sbTill],
SBizInfo[i][sbLocked],
SBizInfo[i][sbProducts],
SBizInfo[i][sbMaxProducts],
SBizInfo[i][sbPriceProd],
i);
self_mysql_queryEx(var);
}
for(new i = 0; 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)
{
format(string, sizeof(string), "INSERT INTO `tankenbiz` (`TankenBizID`) VALUES ('%d')", i);
self_mysql_queryEx(string);
}
mysql_free_result(MySQLConnection);
new var[768];
format(var, sizeof(var), "UPDATE `tankenbiz` SET `Owned`='%d', `Owner`='%s', `Message`='%s', `Extortion`='%s', `LevelNeeded`='%d', `KaufPreis`='%d', `SpritPreis`='%d', `Kasse`='%d', `Locked`='%d', `Products`='%d', `MaxProducts`='%d', `ProdPreis`='%d' WHERE `TankenBizID`='%d'",
TankenBizInfo[i][TBOwned],
TankenBizInfo[i][TBOwner],
TankenBizInfo[i][TBMessage],
TankenBizInfo[i][TBExtortion],
TankenBizInfo[i][TBLevelNeeded],
TankenBizInfo[i][TBKaufPreis],
TankenBizInfo[i][TBSpritPreis],
TankenBizInfo[i][TBKasse],
TankenBizInfo[i][TBLocked],
TankenBizInfo[i][TBProducts],
TankenBizInfo[i][TBMaxProducts],
TankenBizInfo[i][TBProdPreis],
i);
self_mysql_queryEx(var);
}
Das ist der Speicher Code, dort werden die Sachen falls diese nicht in der Datenbank sind, eingetragen.
PS: Falls bei den einzelnen Datenbanken(Biz, sBiz, Tankstelle und Haus) Auto Increment an ist, solltest du dies ausmachen.