Problem with using dynamic "/buyhouse"
#1

Hello,

pawn Код:
dcmd_buyhouse(playerid,params[])
{
    #pragma unused params
    for(new h = 0; h < MAX_HOUSES; h ++)
    {
        format(file,sizeof(file),"Stuff/Houses/%d.ini",h);
        if(dini_Exists(file))
        {
            if(IsPlayerInRangeOfPoint(playerid,5,HouseInfo[h][PickupOutsidePosX],HouseInfo[h][PickupOutsidePosY],HouseInfo[h][PickupOutsidePosZ]))
            {
                if(!strlen(HouseInfo[h][Owner]))
                {
                    if(GetPlayerMoney(playerid) >= HouseInfo[h][Price])
                    {
                        new string[70];
                        format(string,sizeof(string),"Do you want to buy this house for $%d?",HouseInfo[h][Price]);
                        ShowPlayerDialog(playerid,DIALOG_BUYHOUSE,DIALOG_STYLE_MSGBOX,"Buy a House",string,"Yes","No");
                        SetPVarInt(playerid,"BuyingHouse",h);
                    }
                    else return SendClientMessage(playerid,COLOR_WHITE,"You do not have enough money to purchase this house.");
                }
                else return SendClientMessage(playerid,COLOR_WHITE,"    This house has already been bought.");
            }
            else return SendClientMessage(playerid,COLOR_WHITE,"    You are not near any unbought house pickup.");
        }
    }
    return 1;
}
This works fine for house ID 0 (so file is called 0). But for the others, it just gives the message 'You are not near any unbought house pickup'. Why? Everything in the enum is just fine.

Regards, Jochem

Note: MAX_HOUSES = 200.
Reply


Messages In This Thread
Problem with using dynamic "/buyhouse" - by Jochemd - 30.12.2010, 14:13
Re: Problem with using dynamic "/buyhouse" - by _rAped - 30.12.2010, 14:14
Re: Problem with using dynamic "/buyhouse" - by Jochemd - 30.12.2010, 14:17
Re: Problem with using dynamic "/buyhouse" - by MadeMan - 30.12.2010, 14:36
Re: Problem with using dynamic "/buyhouse" - by Jochemd - 30.12.2010, 14:50
Re: Problem with using dynamic "/buyhouse" - by Surmav - 30.12.2010, 16:18
Re: Problem with using dynamic "/buyhouse" - by Ash. - 30.12.2010, 16:22
Re: Problem with using dynamic "/buyhouse" - by Jochemd - 30.12.2010, 16:27

Forum Jump:


Users browsing this thread: 3 Guest(s)