When I buy a second or third business it doesn't set a key
#2

try this i hope it will work
PHP код:
    else if ((id Business_Nearest(playerid)) != -1)
    {
        if (
Business_GetCount(playerid) >= MAX_OWNABLE_BUSINESSES)
            return 
SendErrorMessage(playerid"You can only own %d businesses at a time."MAX_OWNABLE_BUSINESSES);
        if (
BusinessData[id][bizOwner] != 0)
            return 
SendErrorMessage(playerid"This business is already owned at the moment.");
        if (
BusinessData[id][bizPrice] > GetMoney(playerid))
            return 
SendErrorMessage(playerid"You have insufficient funds for the purchase.");
        
BusinessData[id][bizOwner] = GetPlayerSQLID(playerid);
        
Business_Refresh(id);
        
Business_Save(id);
        
GiveMoney(playerid, -BusinessData[id][bizPrice]);
        
SendServerMessage(playerid"You have purchased \"%s\" for %s!"BusinessData[id][bizName], FormatNumber(BusinessData[id][bizPrice]));
        
ShowPlayerFooter(playerid"You have ~g~purchased~w~ a business!");
        
Log_Write("logs/biz_log.txt""[%s] %s has purchased business ID: %d for %s."ReturnDate(), ReturnName(playerid), idFormatNumber(BusinessData[id][bizPrice]));
         if(
PlayerData[playerid][pBusinessKey][0] == 0)  PlayerData[playerid][pBusinessKey][0] = id;
         else if(
PlayerData[playerid][pBusinessKey][1] == 0)  PlayerData[playerid][pBusinessKey][1] = id;
        else if(
PlayerData[playerid][pBusinessKey][2] == 0)  PlayerData[playerid][pBusinessKey][2] = id;
    } 
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)