Jump to content
  • 0

problema sellhouse


InceMan

Question

Problema intalnita (descriere):nu pot sa ii vand cuie-va casa care o detin eu si doar sa ii pun price la casa merge sa pun  
Ero(area / rile) / warning-(ul / urile):nu sunt
Liniile de cod / sursa / script-ul(obligatoriu):

CMD:sellhouse(playerid, params[])
{
    if(playerVariables[playerid][pStatus] >= 100)
    {
        new housePrice;
        new houseID = getPlayerHouseID(playerid);
        if(sscanf(params, "d", housePrice))
            return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/sellhouse [price]");

        if(houseID < 1)
            return 1;

        new labelString[96];

        if(housePrice != 0 && housePrice > 0)
        {
            switch(houseVariables[houseID][hHouseLocked])
            {
                case 1:
                {
                    format(labelString, sizeof(labelString), "House %d (owned)\nOwner: %s\nRent: %d\nPrice: $%s\n\nPress ~k~~F to enter.", houseID,houseVariables[houseID][hHouseOwner],houseVariables[houseID][hRent], NumberFormat(houseVariables[houseID][hHousePrice]));
                }
                case 0:
                {
                    format(labelString, sizeof(labelString), "House %d (owned)\nOwner: %s\nRent: %d\nPrice: $%s\n\n(locked)", houseID,houseVariables[houseID][hHouseOwner], houseVariables[houseID][hRent], NumberFormat(houseVariables[houseID][hHousePrice]));
                }
            }

            houseVariables[houseID][hHousePrice] = housePrice;

            DestroyDynamicPickup(houseVariables[houseID][hPickupID]);
            DestroyDynamic3DTextLabel(houseVariables[houseID][hLabelID]);

            houseVariables[houseID][hLabelID] = CreateDynamic3DTextLabel(labelString, COLOR_YELLOW, houseVariables[houseID][hHouseExteriorPos][0], houseVariables[houseID][hHouseExteriorPos][1], houseVariables[houseID][hHouseExteriorPos][2], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0);
            houseVariables[houseID][hPickupID] = CreateDynamicPickup(1272, 23, houseVariables[houseID][hHouseExteriorPos][0], houseVariables[houseID][hHouseExteriorPos][1], houseVariables[houseID][hHouseExteriorPos][2], 0, houseVariables[houseID][hHouseExteriorID], -1, 250);

            format(labelString, sizeof(labelString), "House has been put on sold for $%s!", NumberFormat(houseVariables[houseID][hHousePrice]));
            SendClientMessage(playerid, COLOR_WHITE, labelString);

            saveHouse(houseID);
        }
        else if(housePrice == 0)
        {
            switch(houseVariables[houseID][hHouseLocked])
            {
                case 1:
                {
                    format(labelString, sizeof(labelString), "House %d (owned)\nOwner: %s\nRent: %d\n\n(locked)", houseID, houseVariables[houseID][hHouseOwner], houseVariables[houseID][hRent]);

                }
                case 0:
                {
                    format(labelString, sizeof(labelString), "House %d (owned)\nOwner: %s\nRent: %d\n\nPress ~k~~F to enter.", houseID,houseVariables[houseID][hHouseOwner], houseVariables[houseID][hRent]);
                }
            }


            DestroyDynamicPickup(houseVariables[houseID][hPickupID]);
            DestroyDynamic3DTextLabel(houseVariables[houseID][hLabelID]);

            houseVariables[houseID][hLabelID] = CreateDynamic3DTextLabel(labelString, COLOR_YELLOW, houseVariables[houseID][hHouseExteriorPos][0], houseVariables[houseID][hHouseExteriorPos][1], houseVariables[houseID][hHouseExteriorPos][2], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0);
            houseVariables[houseID][hPickupID] = CreateDynamicPickup(1272, 23, houseVariables[houseID][hHouseExteriorPos][0], houseVariables[houseID][hHouseExteriorPos][1], houseVariables[houseID][hHouseExteriorPos][2], 0, houseVariables[houseID][hHouseExteriorID], -1, 250);
            houseVariables[houseID][hHousePrice] = 0;
            format(labelString, sizeof(labelString), "House has been removed from sold!");
            SendClientMessage(playerid, COLOR_WHITE, labelString);

            saveHouse(houseID);
        }

    }
    return 1;
}


Imagini / Video (optional):nu am
Ati incercat sa rezolvati singur?: da si nu merge

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0
16 minutes ago, Zephyr. said:

Pai in codul tau doar ii seteaza pretul de vanzare.

si cum il fac sa si sa o pot vinde pe casa

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

  • 0

pai tu ai comanda sellhouse? adica comanda asellhouse ca banuiesc ca e pentru admini, comanda postata de tine este alta,

daca nu ai comanda si tu vrei sa ne spui noua ca vrei sa iti dam aceasta comanda, sa stii ca nu se cer scripturi

Edited by Mister

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
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.