Jump to content

Probleme bizuri


Recommended Posts

Salutare, am o problema cu bizz-urile de pe server, nustiu exact care e problema exacta, de exemplu in stats, dupa ce cumpar casa imi apare ca am casa la care am dat /buybiz dar dupa restart la biz owner in baza de date este pus numele meu dar cand se incarca pe server apare The State, aveti idee de la ce e? Mentionez ca am gm HPQ123


Codul de la loadbizz

Citat

function LoadBizz() {
    new bizz = cache_num_rows();
    for(new i = 1; i <= bizz; i++) {
        new idd = i - 1;
        cache_get_field_content(idd, "Owner", BizzInfo[i][bOwner], SQL, MAX_PLAYER_NAME);
        cache_get_field_content(idd, "Message", BizzInfo[i][bMessage], SQL, 64);
        BizzInfo[i][bID]                = cache_get_field_content_int(idd, "ID");            
        BizzInfo[i][bOwned]                = cache_get_field_content_int(idd, "Owned");
           BizzInfo[i][bEntranceX]            = cache_get_field_content_float(idd, "EntranceX");        
           BizzInfo[i][bEntranceY]            = cache_get_field_content_float(idd, "EntranceY");        
           BizzInfo[i][bEntranceZ]            = cache_get_field_content_float(idd, "EntranceZ");        
           BizzInfo[i][bExitX]                = cache_get_field_content_float(idd, "ExitX");            
           BizzInfo[i][bExitY]                = cache_get_field_content_float(idd, "ExitY");            
           BizzInfo[i][bExitZ]                = cache_get_field_content_float(idd, "ExitZ");            
           BizzInfo[i][bLevel]                = cache_get_field_content_int(idd, "LevelNeeded");         
           BizzInfo[i][bBuyPrice]            = cache_get_field_content_int(idd, "BuyPrice");         
           BizzInfo[i][bFee]                 = cache_get_field_content_int(idd, "EntranceCost");             
           BizzInfo[i][bBalance]            = cache_get_field_content_int(idd, "Till");        
           BizzInfo[i][bLocked]             = cache_get_field_content_int(idd, "Locked");         
           BizzInfo[i][bInterior]            = cache_get_field_content_int(idd, "Interior");         
           BizzInfo[i][bVirtual]            = cache_get_field_content_int(idd, "Virtual");         
         BizzInfo[i][bRadio]                = cache_get_field_content_int(idd, "Radio");        
         BizzInfo[i][bStatic]            = cache_get_field_content_int(idd, "Static");         
         BizzInfo[i][bGas]                = cache_get_field_content_int(idd, "Gas");            
         BizzInfo[i][bType]                = cache_get_field_content_int(idd, "Type");            
    }
    for(new x = 1; x <= bizz; x++) {
        BizzInfo[x][bPickup] = CreateDynamicPickup(BizzInfo[x][bType] != 19 ? 1239 : 1318, 23, BizzInfo[x][bEntranceX], BizzInfo[x][bEntranceY], BizzInfo[x][bEntranceZ]);
        UpdateLabel(2,BizzInfo[x][bID]);    
        LoadGPS(BizzInfo[x][bType], x);
        PickupInfo[BizzInfo[x][bPickup]][pkID] = x;
        PickupInfo[BizzInfo[x][bPickup]][pkType] = 2;

        switch(BizzInfo[x][bType]) {
            case 1: CreateDynamicMapIcon(BizzInfo[x][bEntranceX], BizzInfo[x][bEntranceY], BizzInfo[x][bEntranceZ],52,0,-1,0,-1,500.0); // banca
            case 2: CreateDynamicMapIcon(BizzInfo[x][bEntranceX], BizzInfo[x][bEntranceY], BizzInfo[x][bEntranceZ],6,0,-1,0,-1,500.0); // gun shop
            case 3: CreateDynamicMapIcon(BizzInfo[x][bEntranceX], BizzInfo[x][bEntranceY], BizzInfo[x][bEntranceZ],49,0,-1,0,-1,500.0); // club
            case 4: CreateDynamicMapIcon(BizzInfo[x][bEntranceX], BizzInfo[x][bEntranceY], BizzInfo[x][bEntranceZ],50,0,-1,0,-1,500.0); // restaurant    
            case 5: CreateDynamicMapIcon(BizzInfo[x][bEntranceX], BizzInfo[x][bEntranceY], BizzInfo[x][bEntranceZ],38,0,-1,0,-1,500.0); // sexshop    
            case 6: CreateDynamicMapIcon(BizzInfo[x][bEntranceX], BizzInfo[x][bEntranceY], BizzInfo[x][bEntranceZ],17,0,-1,0,-1,500.0); // 24/7    
            case 7: CreateDynamicMapIcon(BizzInfo[x][bEntranceX], BizzInfo[x][bEntranceY], BizzInfo[x][bEntranceZ],45,0,-1,0,-1,500.0); // binco
            case 8: CreateDynamicMapIcon(BizzInfo[x][bEntranceX], BizzInfo[x][bEntranceY], BizzInfo[x][bEntranceZ],10,0,-1,0,-1,500.0); // burger    
            case 9: CreateDynamicMapIcon(BizzInfo[x][bEntranceX], BizzInfo[x][bEntranceY], BizzInfo[x][bEntranceZ],25,0,-1,0,-1,500.0); // casino    
            case 10: CreateDynamicMapIcon(BizzInfo[x][bEntranceX], BizzInfo[x][bEntranceY], BizzInfo[x][bEntranceZ],16,0,-1,0,-1,500.0); // cnn    
            case 12: CreateDynamicMapIcon(BizzInfo[x][bEntranceX], BizzInfo[x][bEntranceY], BizzInfo[x][bEntranceZ],55,0,-1,0,-1,500.0); // car                
            case 13: CreateDynamicMapIcon(BizzInfo[x][bEntranceX], BizzInfo[x][bEntranceY], BizzInfo[x][bEntranceZ],23,0,-1,0,-1,500.0); // cs                
            case 15: CreateDynamicMapIcon(BizzInfo[x][bEntranceX], BizzInfo[x][bEntranceY], BizzInfo[x][bEntranceZ],63,0,-1,0,-1,500.0); // car color            
            case 16: CreateDynamicMapIcon(BizzInfo[x][bEntranceX], BizzInfo[x][bEntranceY], BizzInfo[x][bEntranceZ],23,0,-1,0,-1,500.0); // paint        
            case 17: CreateDynamicMapIcon(BizzInfo[x][bEntranceX], BizzInfo[x][bEntranceY], BizzInfo[x][bEntranceZ],51,0,-1,0,-1,500.0); // gas station        
            case 18: CreateDynamicMapIcon(BizzInfo[x][bEntranceX], BizzInfo[x][bEntranceY], BizzInfo[x][bEntranceZ],53,0,-1,0,-1,500.0); // race    
            case 19: CreateDynamicMapIcon(BizzInfo[x][bEntranceX], BizzInfo[x][bEntranceY], BizzInfo[x][bEntranceZ],63,0,-1,0,-1,500.0); // pns        
            case 20: CreateDynamicMapIcon(BizzInfo[x][bEntranceX], BizzInfo[x][bEntranceY], BizzInfo[x][bEntranceZ],9,0,-1,0,-1,500.0); // pescarie    
            case 21: CreateDynamicMapIcon(BizzInfo[x][bEntranceX], BizzInfo[x][bEntranceY], BizzInfo[x][bEntranceZ],29,0,-1,0,-1,500.0); // pizza
            case 23: CreateDynamicMapIcon(BizzInfo[x][bEntranceX], BizzInfo[x][bEntranceY], BizzInfo[x][bEntranceZ],9,0,-1,0,-1,500.0); // tuning
            case 27: CreateDynamicMapIcon(BizzInfo[x][bEntranceX], BizzInfo[x][bEntranceY], BizzInfo[x][bEntranceZ],9,0,-1,0,-1,500.0); // tuning
        }
    }
    bussines = bizz;
    printf("Bussines: %d", bizz);
    return true;
}

Codul de la :buybiz

 

Citat

YCMD:buybiz(playerid, params[], help) {
    new id, string[256];
    if(PlayerInfo[playerid][pBizz] != 255) return SCM(playerid, COLOR_WHITE, "Ai deja un biz! Foloseste /sellbiztostate pentru a-l vinde.");
    for(new b = 1; b < sizeof(BizzInfo); b++) {
        if(PlayerToPoint(2, playerid, BizzInfo[b][bEntranceX], BizzInfo[b][bEntranceY], BizzInfo[b][bEntranceZ]) && BizzInfo[b][bBuyPrice] != 0) {
            if(PlayerInfo[playerid][pLevel] < BizzInfo[b][bLevel]) {
                format(string, sizeof(string), "Ai nevoie de nivel %d pentru a cumpara.",BizzInfo[b][bLevel]);
                SCM(playerid, COLOR_WHITE, string);
                return true;
            }
            if(PlayerMoney(playerid, BizzInfo[b][bBuyPrice])) return SCM(playerid, COLOR_GREY, "Nu ai destui bani pentru a face asta.");
            gQuery[0] = EOS;
            id = GetPlayerID(BizzInfo[b][bOwner]);
            if(id != INVALID_PLAYER_ID) {
                PlayerInfo[id][pBizz] = 255;
                Update(id, pBizzx);
                GivePlayerBank(id, BizzInfo[b][bBuyPrice]);
                Update(id, pBankx);
                Update(id, pMBankx);
                format(string, sizeof(string), "* %s ti-a cumparat afacerea pentru {19CF2E}$%s{239931}. Banii au fost transferati in contul tau bancar.", GetName(playerid), FormatNumber(BizzInfo[b][bBuyPrice]));
                SCM(id, 0x239931FF, string);
                mysql_format(SQL, gQuery,sizeof(gQuery),"UPDATE users SET `Bank`='%d', `MBank`='%d' WHERE `ID`='%d'",PlayerInfo[id][pAccount],PlayerInfo[id][pStoreAccount], PlayerInfo[id][pSQLID]);
                mysql_tquery(SQL, gQuery, "", "");                    
            }
            else {
                mysql_format(SQL, gQuery, sizeof(gQuery), "SELECT * FROM `users` WHERE `name` = '%s'", BizzInfo[b][bOwner]);
                mysql_tquery(SQL, gQuery, "CheckUsers", "ii", 1, b);
            }                
            PlayerInfo[playerid][pBizz] = b;
            BizzInfo[b][bOwned] = 1;
            format(BizzInfo[b][bOwner], 256, GetName(playerid));        
            GivePlayerCash(playerid, 0, BizzInfo[b][bBuyPrice]);
            BizzInfo[b][bBuyPrice] = 0;
            mysql_format(SQL, gQuery,sizeof(gQuery),"UPDATE users SET `Money`='%d',`Bizz`='%d' WHERE `ID`='%d'",MoneyMoney[playerid],PlayerInfo[playerid][pBizz],PlayerInfo[playerid][pSQLID]);
            mysql_tquery(SQL, gQuery, "", "");
            mysql_format(SQL, gQuery,sizeof(gQuery),"UPDATE `bizz` SET `Owned`='1',`Owner`='%s',`BuyPrice`='0' WHERE `ID`='%d'",BizzInfo[b][bOwner],b);
            mysql_tquery(SQL, gQuery, "", "");
            UpdateLabel(2,b);
            finishAchievement(playerid, 2);    
            SCM(playerid, COLOR_MONEY, "Felicitari! Ai cumparat aceasta afacere.");
        }
    }
    return true;
}

Mentionez ca e doar la biz-uri.... la case nu..

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.