Jump to content
  • 0

Probleme cu sistemul de business


ImTouchk

Question

Problema intalnita (descriere): Pai, atunci cand sunt pe server HARD-RP, ma duc la un biz, vreau sa-l iau, dau /buy, pur si simplu spune: "Poti detine 8 business-uri(setate de mine) in acelasi timp.", si defapt nu am niciun biz.
Ero(area / rile) / warning-(ul / urile): You can own 8 businesses at a time.
Liniile de cod / sursa / script-ul(obligatoriu): Va las roleplay.pwn mai jos
Imagini / Video (optional): - 
Ati incercat sa rezolvati singur?: Da nicio rezolvare si astazi il lansez pe host, am facut multe rezolvari la gm dar asta nu reusesc. Mai jos aveti .pwn  EDIT: EquiNox credd ca o sa stii tu deoarece tu l-ai facut

roleplay.pwn

Edited by ImTouchk

:D

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0

    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), id, FormatNumber(BusinessData[id][bizPrice]));
    }

acesta este codul(din cmd:buy)

:D

Link to comment
Share on other sites

  • 0

Business_GetCount(playerid)
{
    new
        count = 0;

    for (new i = 0; i != MAX_BUSINESSES; i ++)
    {
        if (BusinessData[bizExists] && Business_IsOwner(playerid, i))
           {
               count++;
        }
    }
    return count;
}

:D

Link to comment
Share on other sites

  • 0

Business_IsOwner(playerid, bizid)
{
    if (!PlayerData[playerid][pLogged] || PlayerData[playerid][pID] == -1)
        return 0;

    if (BusinessData[bizid][bizExists] && BusinessData[bizid][bizOwner] == 99999999 && PlayerData[playerid][pAdmin] > 0)
        return 1;

    if ((BusinessData[bizid][bizExists] && BusinessData[bizid][bizOwner] != 0) && BusinessData[bizid][bizOwner] == PlayerData[playerid][pID])
        return 1;

    return 0;
}

:D

Link to comment
Share on other sites

  • 0

 if (BusinessData[bizid][bizExists] && BusinessData[bizid][bizOwner] == 99999999 && PlayerData[playerid][pAdmin] > 0)  

asta cred ca este problema.Esti admin si nu te lasa sa detii biz probabil, nu stiu de ce ar fi pusa aceasta conditie. Incearca sa cumperi un biz fara sa fii admin.

Edited by Jamal Alin

Cea mai sigura sursa de facut bani de buzunar in mediul virtual. Inregistreaza-te si pune-te pe treaba !!!

http://www.viespar.ro/?reff=ab8e9d8086304d6136eac03c710238d7

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.