Buyhouse/licenses/food/weapons in 1 command /buy
#3

uhm, that want i not

look i have this

pawn Код:
if(strcmp(cmd, "/buy", true) == 0)
    {
        for(new i = 0; i <sizeof(HouseInfo); i++)
        {
            if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
            {
                if(PlayerInfo[playerid][pLevel] < HouseInfo[i][hLevel])
                {
                    format(string, sizeof(string), "You must be level %d to buy this house.", HouseInfo[i][hLevel]);
                    SendClientMessage(playerid, COLOR_RED, string);
                    return 1;
                }
                if(PlayerInfo[playerid][pHouseKey] != 255)
                {
                    SendClientMessage(playerid, COLOR_RED, "You are already owning a house, Sell that first.");
                    return 1;
                }
                if(HouseInfo[i][hOwned] == 1)
                {
                    SendClientMessage(playerid, COLOR_RED, "This house you are trying to buy is already owned.");
                    return 1;
                }
                if(GetPlayerMoney(playerid) < HouseInfo[i][hValue])
                {
                  format(string, sizeof(string), "You need $%d,- dollars in cash to buy this house.", HouseInfo[i][hValue]);
                    SendClientMessage(playerid, COLOR_RED, string);
                    return 1;
                }
                else
                {
                    SetPlayerPos(playerid, HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]);
                    SetPlayerInterior(playerid, HouseInfo[i][hInt]);
                    SetPlayerVirtualWorld(playerid, HouseInfo[i][hWorld]);
                    GivePlayerMoney(playerid, -HouseInfo[i][hValue]);
                    HouseInfo[i][hOwned] = 1;
                    strmid(HouseInfo[i][hOwner], playername, 0, strlen(playername), 25);
                    PlayerInfo[playerid][pHouseKey] = i;
                    OnHouseUpdate();
                    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    if(HouseInfo[i][hOwned] == 0)
                    {
                      //DestroyMapIcon(HOUSE_ICON[i]);
                        //HOUSE_ICON[i] = CreateMapIcon(31, 0, HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]);
                        DestroyPickup(HOUSE_PICKUP[i]);
                        HOUSE_PICKUP[i] = CreatePickup(1273, 2, HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]);
                    }
                    else
                    {
                      //DestroyMapIcon(HOUSE_ICON[i]);
                        //HOUSE_ICON[i] = CreateMapIcon(32, 0, HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]);
                        DestroyPickup(HOUSE_PICKUP[i]);
                        HOUSE_PICKUP[i] = CreatePickup(1272, 2, HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]);
                    }
                    format(string, sizeof(string), "You have successfully bought this house for $%d,-", HouseInfo[i][hValue]);
                    SendClientMessage(playerid, COLOR_YELLOW, string);
                }
                if(PlayerToPoint(4, playerid, -1937.1833,302.8028,445.7198))
                {
                TogglePlayerControllable(playerid, 0);
                    ShowMenuForPlayer(LicenseMenu, playerid);
                }
                if(PlayerToPoint(4, playerid, 312.1129,-165.3791,999.6010))
            {
                TogglePlayerControllable(playerid, 0);
                    ShowMenuForPlayer(WeaponMenu, playerid);
                }
                if(PlayerToPoint(4, playerid, -27.9545,-89.8021,1003.5469))
            {
                TogglePlayerControllable(playerid, 0);
                    ShowMenuForPlayer(FoodMenu, playerid);
            }
            }
        }
        return 1;
    }
i do by a house /buy (it buy the house this work)

but at the ammunation,supermarket,license shop don't work :S
Reply


Messages In This Thread
Buyhouse/licenses/food/weapons in 1 command /buy - by sjvt - 08.03.2010, 19:37
Re: Buyhouse/licenses/food/weapons in 1 command /buy - by aircombat - 08.03.2010, 22:13
Re: Buyhouse/licenses/food/weapons in 1 command /buy - by sjvt - 09.03.2010, 13:05
Re: Buyhouse/licenses/food/weapons in 1 command /buy - by sjvt - 09.03.2010, 20:15

Forum Jump:


Users browsing this thread: 1 Guest(s)