17.03.2017, 15:58
Hello i have problem On Biz System The Till Wont be saved but all other info are saved just the till when i logout and renter find him 0$ this is cmd and the save
And The Cmd
Anf This Is the dialog for /buy
PHP код:
forward SaveBusinesses();
SaveBusinesses()
{
for(new i = 0; i < MAX_BIZ; i++)
{
new file[32];
format(file,sizeof(file),"/Business/ID%d.ini", i);
dini_Set(file, "Name", BizInfo[i][Name]);
dini_Set(file, "Owner", BizInfo[i][Owner]);
dini_IntSet(file, "Till", BizInfo[i][Till]);
dini_IntSet(file, "Genre", BizInfo[i][Genre]);
dini_FloatSet(file, "XCoord",BizInfo[i][XCoord]);
dini_FloatSet(file, "YCoord", BizInfo[i][YCoord]);
dini_FloatSet(file, "ZCoord", BizInfo[i][ZCoord]);
dini_IntSet(file, "Price", BizInfo[i][Price]);
dini_IntSet(file, "Owned", BizInfo[i][Owned]);
dini_IntSet(file, "VW", i);
dini_FloatSet(file, "IXCoord",BizInfo[i][IXCoord]);
dini_FloatSet(file, "IYCoord", BizInfo[i][IYCoord]);
dini_FloatSet(file, "IZCoord", BizInfo[i][IZCoord]);
dini_IntSet(file, "Int", BizInfo[i][Int]);
dini_IntSet(file, "MapID", BizInfo[i][MapID]);
return 1;
}
return 1;
}
PHP код:
CMD:checktill(playerid)
{
for(new biz = 0; biz < MAX_BIZ; biz++)
{
if(IsPlayerInRangeOfPoint(playerid, 100, BizInfo[biz][IXCoord], BizInfo[biz][IYCoord], BizInfo[biz][IZCoord]))
{
if(GetPlayerVirtualWorld(playerid) == BizInfo[biz][VW])
{
if(!strcmp(BizInfo[biz][Owner], GetPlayerNameEx(playerid), true))
{
new string[150];
format(string,sizeof(string),"Your business till contains $%d.", BizInfo[biz][Till]);
SendClientMessage(playerid, COLOR_GREY, string);
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "You're not in your bussiness.");
}
}
}
}
return 1;
}
PHP код:
if(dialogid == STOREMENU)
{
if(response)
{
if(listitem == 0)
{
if (GetPlayerCash(playerid) >= 500)
{
new randphone = 1000 + random(9999);//minimum 1000 max 9999
ReplacePH(PlayerInfo[playerid][pNumber], randphone);
PlayerInfo[playerid][pNumber] = randphone;
format(string, sizeof(string), "Cellphone purchased, your new phone number is %d.", randphone);
SendClientMessageEx(playerid, COLOR_GRAD4, string);
SendClientMessageEx(playerid, COLOR_GRAD5, "You can check this any time you wish by typing /stats.");
SendClientMessageEx(playerid, COLOR_WHITE, "HINT: You can now type /cellphonehelp to see your cellphone commands.");
if(PlayerInfo[playerid][pDonator] >= 1)
{
GivePlayerCash(playerid, -400);
BizInfo[BizIDS[playerid]][Till] += 400;
SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You have received 20 percent off this product. Instead of paying $500, you paid $400.");
}
else
{
BizInfo[BizIDS[playerid]][Till] += 500;
GivePlayerCash(playerid, -500);
}
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD4, "You don't have the cash for this item!");
}
}