#1

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
PHP код:
forward SaveBusinesses();
SaveBusinesses()
{
    for(new 
0MAX_BIZi++)
    {
        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;

And The Cmd
PHP код:
CMD:checktill(playerid)
{
    for(new 
biz 0biz MAX_BIZbiz++)
    {
        if(
IsPlayerInRangeOfPoint(playerid100BizInfo[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(playeridCOLOR_GREYstring);
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_GRAD2"You're not in your bussiness.");
                }
            }
        }
    }
    return 
1;

Anf This Is the dialog for /buy
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(stringsizeof(string), "Cellphone purchased, your new phone number is %d."randphone);
                    
SendClientMessageEx(playeridCOLOR_GRAD4string);
                    
SendClientMessageEx(playeridCOLOR_GRAD5"You can check this any time you wish by typing /stats.");
                    
SendClientMessageEx(playeridCOLOR_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(playeridCOLOR_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(playeridCOLOR_GRAD4"You don't have the cash for this item!");
                }
            } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)