Jump to content
  • 0

Probleme bizz


KB.HERO

Question

Salut am si eu o problema la gm cind un player isi face cont ii da bizzul 255 si cind da sellbiztostate ii zice ca nu are nici un biz 

poza:

image.png.fadc454ce352721141f5a94a89cf9fc7.png

 

Edited by KB.HERO

 Încearcă să fii un om de valoare și nu neapărat un om de succes.

 

Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 0

Salut, 255 este valoarea setata default de sistemul de bizuri care inseamna ca nu detii niciun biz, sistemul e gandit ca nu vei avea mai mult de 244 de bizuri pe server asa ca nu ai cum sa atingi acea valoare, problema ta e la comanda /sellbiztostate posteaza codul sa vedem verificarea unde spune ca nu ai niciun biz. E mai usor sa faci comanda sellbiztostate decat sa dai sistemul peste cap si sa pui valoarea default 0 in caz ca nu te pricepi

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0

CMD:sellbiztostate(playerid,params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(gPlayerLogged[playerid] != 0)
    {
        new string[70];
        if(PlayerInfo[playerid][pPbiskey] == 255) return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}You don't own a bussines.");
        if(strcmp(PlayerInfo[playerid][pNormalName], BizzInfo[PlayerInfo[playerid][pPbiskey]][bOwner], true) == 0)
        {
            new bouse = PlayerInfo[playerid][pPbiskey];
            BizzInfo[bouse][bLocked] = 1;
            BizzInfo[bouse][bOwned] = 0;
            strmid(BizzInfo[bouse][bOwner], "The State", 0, strlen("The State"), 255);
            new cashb = floatround(floatmul(BizzInfo[bouse][bBuyPrice],0.70),floatround_ceil);
            GivePlayerCash(playerid,cashb);
            PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
            format(string, sizeof(string), "~w~Congratulations~n~ You have sold your property for ~n~~g~$%d",cashb);
            GameTextForPlayer(playerid, string, 10000, 3);
            PlayerInfo[playerid][pPbiskey] = 255;
            new str1[184];
            mysql_format(SQL,str1,sizeof(str1),"UPDATE `bizz` SET `Locked`='0',`Owned`='0',`Till`='0',`Owner`='The State' WHERE `ID`='%d'",bouse);
            mysql_tquery(SQL,str1,"","");
            Update(playerid,pCashx);
            Update(playerid, pPbiskeyx);
            PlayerInfo[playerid][pPbiskey] = 255;
            OnPropTextdrawUpdate(2,bouse);
            return 1;
        }
        else return SCM(playerid,COLOR_WHITE,"{FFB870}You don't own a business.");
    }
    return 1;
}

 Încearcă să fii un om de valoare și nu neapărat un om de succes.

 

Link to comment
Share on other sites

  • 0

nu vad nicio problema la sellbiztostate ai zis ca la aceasta comanda ai problema. De ce nu ai postat buybiz daca la ea e problema

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0

CMD:buybiz(playerid,params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(gPlayerLogged[playerid] != 0)
    {
        new Float:oldposx, Float:oldposy, Float:oldposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        new string[128],sendername[25],stringcasa[128];
        for(new b = 1; b < sizeof(BizzInfo); b++)
        {
            if(PlayerToPoint(2.0, playerid, BizzInfo[bEntranceX], BizzInfo[bEntranceY], BizzInfo[bEntranceZ]) && BizzInfo[bOwned] == 0)
            {
                if(PlayerInfo[playerid][pPbiskey] == 255) return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}You already own a business, type /sellbiztostate if you want to buy this one.");
                if(PlayerInfo[playerid][pLevel] < BizzInfo[bLevelNeeded])
                {
                    format(string, sizeof(string), "{FFB870}You must be level %d to purchase this.",BizzInfo[bLevelNeeded]);
                    SendClientMessage(playerid, COLOR_WHITE, string);
                    return 1;
                }
                if(GetPlayerCash(playerid) > BizzInfo[bBuyPrice])
                {
                    PlayerInfo[playerid][pPbiskey] = b;
                    BizzInfo[bOwned] = 1;
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    strmid(BizzInfo[bOwner], PlayerInfo[playerid][pNormalName], 0, 25, 255);
                    GivePlayerCash(playerid,-BizzInfo[bBuyPrice]);
                    GameTextForPlayer(playerid, "~w~Welcome~n~You can exit at any time by moving to this door and press enter", 5000, 3);
                    if(BizzInfo[bSbiz] == 0)
                    {
                        PlayerInfo[playerid][pInt] = BizzInfo[bInterior];
                        PlayerInfo[playerid][pLocal] = b ;
                        InBussines[playerid] = b;
                        SetPlayerInterior(playerid,BizzInfo[bInterior]);
                        SetPlayerVirtualWorld(playerid, BizzInfo[bVirtual]);
                        PlayerInfo[playerid][pInt] = BizzInfo[bInterior];
                        SetPlayerPosEx(playerid,BizzInfo[bExitX],BizzInfo[bExitY],BizzInfo[bExitZ]);
                    }
                    SendClientMessage(playerid, COLOR_WHITE, "Congratulations, On Your New Purchase.");
                    SendClientMessage(playerid, COLOR_WHITE, "Type /help to review the new business help section.");
                    format(stringcasa, sizeof(stringcasa), "%s [user:%d] a cumparat bizz-ul [bizz:%d] de la Stat pentru $%s.",sendername,PlayerInfo[playerid][pSQLID],b,FormatNumber(BizzInfo[bBuyPrice]));
                    ABroadCast(COLOR_YELLOW, stringcasa,1);
                    new var100[256],y,m,d,h,mi,s,string2[256],string3[256];
                    getdate(y,m,d);
                    gettime(h,mi,s);
                    format(string2,sizeof(string2),"[%02d-%02d-%d %02d:%02d:%02d] %s[user:%d] bought bizz %d for $%s.",d,m,y,h,mi,s,sendername,PlayerInfo[playerid][pSQLID],b,FormatNumber(BizzInfo[bBuyPrice]));
                     mysql_real_escape_string(string2, string3);
                    mysql_format(SQL, var100, sizeof(var100), "INSERT INTO playerlogs (`playerid`,`giverid`,`action`,`time`) VALUES ('%d','0','%s','%02d-%02d-%d %02d:%02d:%02d')", PlayerInfo[playerid][pSQLID],string3,d,m,y,h,mi,s);
                    mysql_tquery(SQL,var100,"","");
                    new str1[256];
                    mysql_format(SQL,str1,sizeof(str1),"UPDATE users SET `Money`='%d',`Bizz`='%d' WHERE `name`='%s'",GetPlayerCash(playerid),PlayerInfo[playerid][pPbiskey],PlayerInfo[playerid][pNormalName]);
                    mysql_tquery(SQL,str1,"","");
                    mysql_format(SQL,str1,sizeof(str1),"UPDATE `bizz` SET `Owned`='1',`Owner`='%s' WHERE `ID`='%d'",BizzInfo[bOwner],b);
                    mysql_tquery(SQL,str1,"","");
                    OnPropTextdrawUpdate(2,b);
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_WHITE, "You don't have the cash for that");
                    return 1;
                }
            }
        }
    }
    return 1;
}

 

 Încearcă să fii un om de valoare și nu neapărat un om de succes.

 

Link to comment
Share on other sites

  • 0

Aici este problema:

if(PlayerInfo[playerid][pPbiskey] == 255) return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}You already own a business, type /sellbiztostate if you want to buy this one.");

 

Daca playerid are pPbiskey 255 ii trimite acel mesaj cu "you already own a business, type..." 

Nu stiu exact cum ai tu game modeul dar incearca sa pui "!=" in loc  de "==", dar acum nu stiu daca peste tot iti pune cand nu ai biz valoare 255, in comanda sellbiztostate vad ca iti seteaza 255, acum mai departe poti verifica tu.

Link to comment
Share on other sites

  • 0
1 hour ago, custura said:

Aici este problema:

if(PlayerInfo[playerid][pPbiskey] == 255) return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}You already own a business, type /sellbiztostate if you want to buy this one.");

 

Daca playerid are pPbiskey 255 ii trimite acel mesaj cu "you already own a business, type..." 

Nu stiu exact cum ai tu game modeul dar incearca sa pui "!=" in loc  de "==", dar acum nu stiu daca peste tot iti pune cand nu ai biz valoare 255, in comanda sellbiztostate vad ca iti seteaza 255, acum mai departe poti verifica tu.

Ai discord ?

 Încearcă să fii un om de valoare și nu neapărat un om de succes.

 

Link to comment
Share on other sites

  • 0
1 minute ago, Depressive_ said:

Tu ne intrebi sau nu stii ce face comanda?

nu stiam dece comanda dadea freeze am gasit care era bubua 

 

am bagat comanda doar ca am dat limita de viteza 150 si cind unu merge cu 150 nu arata nimic 

 Încearcă să fii un om de valoare și nu neapărat un om de succes.

 

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
Answer this question...

×   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.