Property

Započeo devster, Jul 27, 2023, 22:15:37 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 6 gostiju pregledaju ovu temu.

Tip: Include
Slike ili Video: //
Opis i dodatne informacije: //
Download link: //
Scan link: //
Credits: realnaith

/*
 * Property Include
 * Author: [realnaith]
 * Version: 1.0
 */

#define MAX_HOUSES 50

enum HouseStatus
{
    HOUSE_NONE,
    HOUSE_OWNED,
    HOUSE_SOLD,
    HOUSE_RENTED
};

enum HouseTypes
{
    HOUSE_NORMAL,
    HOUSE_LUXURY,
    HOUSE_MANSION
};

#define HOUSE_ICON_MODEL 1272

stock CreateHouseLabel(houseID)
{
    new Float:x = HouseInfo[houseID][House_X];
    new Float:y = HouseInfo[houseID][House_Y];
    new Float:z = HouseInfo[houseID][House_Z];
    new angle = HouseInfo[houseID][House_Angle];
    new housePrice = HouseInfo[houseID][House_Price];
    new houseOwner = HouseInfo[houseID][House_Owner];
    new labelText[256];

    format(labelText, sizeof(labelText), "House %d\nPrice: $%d\nOwner: %s", houseID, housePrice, (houseOwner != INVALID_PLAYER_ID) ? GetPlayerName(houseOwner) : "None");

    new labelID = CreateDynamic3DTextLabel(labelText, HOUSE_ICON_COLOR, x, y, z + 1.0, 15.0, 0, true);
    if (labelID != INVALID_DYNAMIC_3DTEXT_LABEL)
    {
        SetDynamic3DTextLabelDrawDistance(labelID, 50.0);
        SetDynamic3DTextLabelFont(labelID, 0);
        SetDynamic3DTextLabelSize(labelID, 0.5);
    }

    return labelID;
}

stock CreateHouse(playerid, houseType, Float:x, Float:y, Float:z, Float:angle, price)
{
    new houseID = FindEmptyHouseSlot();
    if (houseID == INVALID_HOUSE_ID)
        return INVALID_HOUSE_ID;

    HouseInfo[houseID][House_Type] = houseType;
    HouseInfo[houseID][House_X] = x;
    HouseInfo[houseID][House_Y] = y;
    HouseInfo[houseID][House_Z] = z;
    HouseInfo[houseID][House_Angle] = angle;
    HouseInfo[houseID][House_Status] = HOUSE_OWNED;
    HouseInfo[houseID][House_Price] = price;
    HouseInfo[houseID][House_Owner] = playerid;

    CreateHouseLabel(houseID);

    return houseID;
}

stock GetHouseOwner(houseID)
{
    if (HouseInfo[houseID][House_Status] == HOUSE_OWNED || HouseInfo[houseID][House_Status] == HOUSE_RENTED)
        return HouseInfo[houseID][House_Owner];

    return INVALID_PLAYER_ID;
}

stock BuyHouse(playerid, houseID)
{
    if (HouseInfo[houseID][House_Status] != HOUSE_SOLD)
        return false;

    if (GetPlayerMoney(playerid) < HouseInfo[houseID][House_Price])
        return false;

    SetPlayerMoney(playerid, GetPlayerMoney(playerid) - HouseInfo[houseID][House_Price]);
    HouseInfo[houseID][House_Status] = HOUSE_OWNED;
    HouseInfo[houseID][House_Owner] = playerid;

    return true;
}

stock SellHouse(houseID)
{
    if (HouseInfo[houseID][House_Status] != HOUSE_OWNED)
        return false;

    new ownerid = HouseInfo[houseID][House_Owner];
    SetPlayerMoney(ownerid, GetPlayerMoney(ownerid) + HouseInfo[houseID][House_Price]);
    HouseInfo[houseID][House_Status] = HOUSE_SOLD;
    HouseInfo[houseID][House_Owner] = INVALID_PLAYER_ID;

    return true;
}


new houseID = FindEmptyHouseSlot();

?







Voleo bih da znam sta ti tacno nije jasno ?

Ocekivao si sve na gotovo ?

Citat: realnaith poslato Jul 28, 2023, 17:51:48 POSLE PODNE
Voleo bih da znam sta ti tacno nije jasno ?

Ocekivao si sve na gotovo ?
Gospode, smiluj mu se, jer covjek ne zna sta pise

Citat: ʟᴀᴋᴇʀɪɴɢ poslato Jul 28, 2023, 17:55:59 POSLE PODNE
Gospode, smiluj mu se, jer covjek ne zna sta pise

Ocigledno ti ne znas da citas ??

Citat: ʟᴀᴋᴇʀɪɴɢ poslato Jul 28, 2023, 17:55:59 POSLE PODNE
Gospode, smiluj mu se, jer covjek ne zna sta pise
Idi na translate pa vidi šta znači riječ property pa ćeš skontati

Dok mozak ukljucite, saznat cete

Citat: ʟᴀᴋᴇʀɪɴɢ poslato Jul 28, 2023, 18:15:19 POSLE PODNE
Dok mozak ukljucite, saznat cete

Mozak ukljucim ? Nisi sposoban da procitas prost code...

gl_property je mnogo bolji primjer nego li ovo, mogao si samo da ga odradiš i objaviš, ne vidim poantu u ovome. Znaš li uopće što je sve potrebno da bi mogao nešto da nazoveš include, a i samo određivanje verzije ti ne ide od ruke, ti odmah krenuo od 1.0. Daj mi suvisli odgovor, nemoj ovo smatrati pljuvanjem.

https://pastebin.com/XkAvGpJj
Poslednja Izmena: Jul 28, 2023, 18:43:14 POSLE PODNE od pokerface
You'll be always in my heart, the end and thanks for amazing times. #WeAreLords