Hey, habe ein Problem und kenne es auch, hat was mit meinem Biz-System in MySQL zu tuen.
stock LoadBiz()
{
for(new i=0; i<MAX_BIZ; i++)
{
BizzInfo[i][bID] = i;
BizzInfo[i][bOwned] = mysql_GetInt("Business", "bOwned", "bID", BizzInfo[i][bID]);
BizzInfo[i][bMessage] = mysql_GetString("Business", "bMessage", "bID", BizzInfo[i][bID]);
BizzInfo[i][bOwner] = mysql_GetString("Business", "bOwner", "bID",BizzInfo[i][bID]);
BizzInfo[i][bExtortion] = mysql_GetString("Business", "bExtortion", "bID", BizzInfo[i][bID]);
BizzInfo[i][bEntranceX] = mysql_GetFloat("Business", "bEntranceX", "bID", BizzInfo[i][bID]);
BizzInfo[i][bEntranceY] = mysql_GetFloat("Business", "bEntranceY", "bID", BizzInfo[i][bID]);
BizzInfo[i][bEntranceZ] = mysql_GetFloat("Business", "bEntranceZ", "bID", BizzInfo[i][bID]);
BizzInfo[i][bExitX] = mysql_GetFloat("Business", "bExitX", "bID", BizzInfo[i][bID]);
BizzInfo[i][bExitY] = mysql_GetFloat("Business", "bExitY", "bID", BizzInfo[i][bID]);
BizzInfo[i][bExitZ] = mysql_GetFloat("Business", "bExitZ", "bID", BizzInfo[i][bID]);
BizzInfo[i][bLevelNeeded] = mysql_GetInt("Business", "bLevelNeeded", "bID", BizzInfo[i][bID]);
BizzInfo[i][bBuyPrice] = mysql_GetInt("Business", "bBuyPrice", "bID", BizzInfo[i][bID]);
BizzInfo[i][bEntranceCost] = mysql_GetInt("Business", "bEntraceCost", "bID", BizzInfo[i][bID]);
BizzInfo[i][bTill] = mysql_GetInt("Business", "bTill", "bID", BizzInfo[i][bID]);
BizzInfo[i][bLocked] = mysql_GetInt("Business", "bLocked", "bID", BizzInfo[i][bID]);
BizzInfo[i][bInterior] = mysql_GetInt("Business", "bInterior", "bID", BizzInfo[i][bID]);
BizzInfo[i][bProducts] = mysql_GetInt("Business", "bProducts", "bID", BizzInfo[i][bID]);
BizzInfo[i][bMaxProducts] = mysql_GetInt("Business", "bMaxProducts", "bID", BizzInfo[i][bID]);
BizzInfo[i][bPriceProd] = mysql_GetInt("Business", "bPriceProd", "bID", BizzInfo[i][bID]);
BizzInfo[i][bWorld] = mysql_GetInt("Business", "bWorld", "bID", BizzInfo[i][bID]);
}
return 1;
}
An sich funktioniert das einwandfrei. Jedoch werden nur die Informationen geladen, die die "bID" - > 0 haben. Woher ich das weiß ?
for(new i = 0; i < MAX_BIZ; i++)
{
bizpickup[i] = AddStaticPickup(1239,23,BizzInfo[i][bEntranceX],BizzInfo[i][bEntranceY],BizzInfo[i][bEntranceZ]);
new string[128];
if(BizzInfo[i][bOwned] == 0)
{
format(string,sizeof(string),"{0BE300}Dieses Business steht zum verkauf\n{FFFFFF}Benötigtes Level: {0BE300}%d\n{FFFFFF}Preis: {0BE300}%d",BizzInfo[i][bLevelNeeded],BizzInfo[i][bBuyPrice]);
}
else if(BizzInfo[i][bOwned] == 1)
{
new prodsneed;
prodsneed = BizzInfo[i][bMaxProducts] - BizzInfo[i][bProducts];
format(string,sizeof(string),"{FFFFFF}%s\n{0BE300}Besitzer: {FFFFFF}%s\n{0BE300}Benötigte Produkte: {FFFFFF}%d\n{0BE300}Eintritspreis: {FFFFFF}%d",BizzInfo[BizzInfo[i][bID]][bMessage],BizzInfo[BizzInfo[i][bID]][bOwner],prodsneed,BizzInfo[BizzInfo[i][bID]][bEntranceCost]);
}
biztext[i] = Create3DTextLabel(string,0xFFFFFFFF,BizzInfo[1][bEntranceX],BizzInfo[1][bEntranceY],BizzInfo[1][bEntranceZ], 20.0,0, 0);
biztext[i] = Create3DTextLabel(string,0xFFFFFFFF,BizzInfo[2][bEntranceX],BizzInfo[2][bEntranceY],BizzInfo[2][bEntranceZ], 20.0,0, 0);
}
Es werden nur ein Pickup erstellt, dass bei dem bID auf 0 ist ( in der MySQL Tabelle )
Sollte weiterer Code benötigt werden, bitte hier schreiben.