Hallo liebes Breadfish so ich habe leider ein kleines Problem undzwar wenn ich das
new BizzInfo[10][bInfo];
auf 10 stelle spawnt das Biz mehrmals.. bitte um Hilfe..
LoadBizz();
LoadSBizz();
//========== BUSINESS LABELS =============//
for(new b = 0; b < sizeof(BizzInfo); b++)
{
new string3[128];
if(BizzInfo[b][bOwned] == 0)
{
format(string3, sizeof(string3), "[Business zu Verkaufen - %s]\nPreis: %d$\nLevel: %d", BizzInfo[b][bMessage],BizzInfo[b][bBuyPrice],BizzInfo[b][bLevelNeeded]);
BizzInfo[b][bText] = Create3DTextLabel(string3,COLOR_FORSELL,BizzInfo[b][bEntranceX], BizzInfo[b][bEntranceY], BizzInfo[b][bEntranceZ]+1,15.0,0);
}
if(BizzInfo[b][bOwned] == 1)
{
format(string3, sizeof(string3), "[%s]\nInhaber: %s\nTeilhaber: %s\nEintrittspreis: %d$\nLevel: %d\nProdukte: %d/%d\nPreis pro Produkt: %d", BizzInfo[b][bMessage],BizzInfo[b][bOwner],BizzInfo[b][bExtortion],BizzInfo[b][bEntranceCost],BizzInfo[b][bLevelNeeded],BizzInfo[b][bProducts],BizzInfo[b][bMaxProducts],BizzInfo[b][bPriceProd]);
BizzInfo[b][bText] = Create3DTextLabel(string3,COLOR_BUYED,BizzInfo[b][bEntranceX], BizzInfo[b][bEntranceY], BizzInfo[b][bEntranceZ]+1,15.0,0);
}
}
for(new h = 0; h < sizeof(BizzInfo); h++)
{
if(BizzInfo[h][bOwned] == 0)
{
AddStaticPickup(1272, 1, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]);
pickups++;
}
if(BizzInfo[h][bOwned] == 1)
{
AddStaticPickup(1239, 1, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]);
pickups++;
}
}
format(var, 32, "Bizz=%d\n",PlayerInfo[playerid][pPbiskey]);fwrite(hFile, var);
format(var, 32, "Bizz=%d\n",PlayerInfo[playerid][pPbiskey]);fwrite(hFile, var);
if( strcmp( key , "Bizz" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPbiskey] = strval( val ); }
for(new b = 0; b < sizeof(BizzInfo); b++)
{
if(IsPlayerInRangeOfPoint(playerid,2.0, BizzInfo[b][bEntranceX], BizzInfo[b][bEntranceY], BizzInfo[b][bEntranceZ]) && BizzInfo[b][bOwned] == 0)
{
if(PlayerInfo[playerid][pLevel] < BizzInfo[b][bLevelNeeded])
{
format(string, sizeof(string), "Du benötigst mindestens Level %d, um es kaufen zu können",BizzInfo[b][bLevelNeeded]);
SendClientMessage(playerid, COLOR_GRAD5, string);
return 1;
}
if(GetPlayerMoney(playerid) > BizzInfo[b][bBuyPrice])
{
PlayerInfo[playerid][pPbiskey] = b;
BizzInfo[b][bOwned] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(BizzInfo[b][bOwner], sendername, 0, strlen(sendername), 255);
GivePlayerMoney(playerid,-BizzInfo[b][bBuyPrice]);
PlayerPlayMusic(playerid);
SetPlayerInterior(playerid,BizzInfo[b][bInterior]);
PlayerInfo[playerid][pInt] = BizzInfo[b][bInterior];
SetPlayerPos(playerid,BizzInfo[b][bExitX],BizzInfo[b][bExitY],BizzInfo[b][bExitZ]);
GameTextForPlayer(playerid, "~w~Willkommen~n~Um es zu Verlassen tipp /exit (An der Tuer) ein", 5000, 3);
PlayerInfo[playerid][pInt] = BizzInfo[b][bInterior];
PlayerInfo[playerid][pLocal] = b ;
SendClientMessage(playerid, COLOR_WHITE, "Gratulation für dein neues Gewerbe.");
SendClientMessage(playerid, COLOR_WHITE, "Gib /help ein, um Hilfe für dein neues Gewerbe zu bekommen.");
DateProp(playerid);
//Label Update
new string3[128];
format(string3, sizeof(string3), "[%s]\nInhaber: %s\nTeilhaber: %s\nEintrittspreis: %d$\nLevel: %d\nProdukte: %d/%d\nPreis pro Produkt: %d", BizzInfo[b][bMessage],BizzInfo[b][bOwner],BizzInfo[b][bExtortion],BizzInfo[b][bEntranceCost],BizzInfo[b][bLevelNeeded],BizzInfo[b][bProducts],BizzInfo[b][bMaxProducts],BizzInfo[b][bPriceProd]);
Update3DTextLabelText(BizzInfo[b][bText],COLOR_BUYED,string3);
//Speichern
OnPropUpdate();
PlayerUpdate(playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Du hast nicht genug Geld, um das Gewerbe kaufen zu können.");
return 1;
}
}
}
}
return 1;
}
Function PrintBizInfo(playerid,targetid)
{
if(IsPlayerConnected(playerid))
{
new coordsstring[256];
SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
format(coordsstring, sizeof(coordsstring),"*** %s ***",BizzInfo[targetid][bMessage]);
SendClientMessage(playerid, COLOR_WHITE,coordsstring);
format(coordsstring, sizeof(coordsstring), "Verschlossen: %d Eintrittspreis: $%d Kasse: $%d", BizzInfo[targetid][bLocked], BizzInfo[targetid][bEntranceCost], BizzInfo[targetid][bTill]);
SendClientMessage(playerid, COLOR_GRAD1,coordsstring);
format(coordsstring, sizeof(coordsstring), "Produkte: %d/%d Teilhaber: %s", BizzInfo[targetid][bProducts],BizzInfo[targetid][bMaxProducts],BizzInfo[targetid][bExtortion]);
SendClientMessage(playerid, COLOR_GRAD2,coordsstring);
SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
}
}
Function LoadBizz()
{
new arrCoords[19][64];
new strFromFile2[256];
new File: file = fopen("bizz.cfg", io_read);
if (file)
{
new idx;
while (idx < sizeof(BizzInfo))
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, '|');
BizzInfo[idx][bOwned] = strval(arrCoords[0]);
strmid(BizzInfo[idx][bOwner], arrCoords[1], 0, strlen(arrCoords[1]), 255);
strmid(BizzInfo[idx][bMessage], arrCoords[2], 0, strlen(arrCoords[2]), 255);
strmid(BizzInfo[idx][bExtortion], arrCoords[3], 0, strlen(arrCoords[3]), 255);
BizzInfo[idx][bEntranceX] = floatstr(arrCoords[4]);
BizzInfo[idx][bEntranceY] = floatstr(arrCoords[5]);
BizzInfo[idx][bEntranceZ] = floatstr(arrCoords[6]);
BizzInfo[idx][bExitX] = floatstr(arrCoords[7]);
BizzInfo[idx][bExitY] = floatstr(arrCoords[8]);
BizzInfo[idx][bExitZ] = floatstr(arrCoords[9]);
BizzInfo[idx][bLevelNeeded] = strval(arrCoords[10]);
BizzInfo[idx][bBuyPrice] = strval(arrCoords[11]);
BizzInfo[idx][bEntranceCost] = strval(arrCoords[12]);
BizzInfo[idx][bTill] = strval(arrCoords[13]);
BizzInfo[idx][bLocked] = strval(arrCoords[14]);
BizzInfo[idx][bInterior] = strval(arrCoords[15]);
BizzInfo[idx][bProducts] = strval(arrCoords[16]);
BizzInfo[idx][bMaxProducts] = strval(arrCoords[17]);
BizzInfo[idx][bPriceProd] = strval(arrCoords[18]);
//printf("BizzInfo:%d Owner:%s Message:%s Entfee:%d Till:%d Products:%d/%d Interior:%d.\n",
//LOGSPAMM
/* idx,
BizzInfo[idx][bOwner],
BizzInfo[idx][bMessage],
BizzInfo[idx][bEntranceCost],
BizzInfo[idx][bTill],
BizzInfo[idx][bProducts],
BizzInfo[idx][bMaxProducts],
BizzInfo[idx][bInterior]);*/
idx++;
}
fclose(file);
}
return 1;
}
Function AddToBizzTill(bizzid,amount)
{
SBizzInfo[bizzid][sbTill] += amount;
return 1;
}
So nun wollte ich euch fragen wie ich das mache das mein Biz System nicht 10x Spawnt sondern nur 1x wie angegeben?..
Hoffe um schnelle Antworten mit freundlichen Grüßen
Matze