Problem with /buyprop
#1

pawn Код:
CMD:buyprop(playerid,params[])
{
    if(pInfo[playerid][pHouse] == 1) return SendClientMessage(playerid,COLOR_GREY,"You cannot buy more than one house.");
    for(new i = 1; i < MAX_HOUSES; i++)
    {
        if(IsPlayerInRangeOfPoint(playerid,2,HouseInfo[i][hX],HouseInfo[i][hY],HouseInfo[i][hZ]))
        {
            if(!HouseInfo[i][hX]) continue;
            if(GetPlayerMoney(playerid) >= HouseInfo[i][hPrice])
            {
                if(strcmp(HouseInfo[i][hOwner],"",false))
                {
                    format(HouseInfo[i][hOwner],24,"%s",pName(playerid));
                    pInfo[playerid][pHouse] = 1;
                    format(string,sizeof(string),"You've successfully bought this house.");
                    DestroyDynamicPickup(HouseInfo[i][hPickup]);
                    GivePlayerMoney(playerid,-HouseInfo[i][hPrice]);
                    format(string,sizeof(string),"Owner: %s",HouseInfo[i][hOwner]);
                    HouseInfo[i][hText] = CreateDynamic3DTextLabel(string, 0xFFFFFFFF, HouseInfo[i][hX],HouseInfo[i][hY],HouseInfo[i][hZ], 50, INVALID_PLAYER_ID,INVALID_VEHICLE_ID, 0, -1,0);
                    HouseInfo[i][hPickup] = CreateDynamicPickup(1272,1,HouseInfo[i][hX],HouseInfo[i][hY],HouseInfo[i][hZ],-1,0,-1,50.0);

                }
            }
            else return SendClientMessage(playerid,COLOR_GREY,"You don't have enough money.");
        }
        else return SendClientMessage(playerid,COLOR_GREY,"You're nowhere close to a house.");
    }
    return 1;
}
For some reason this command always returns "You're nowhere close to a house even though I am on the house pickup. Does someone knows the solution.
Reply


Messages In This Thread
Problem with /buyprop - by Tayab - 10.02.2014, 00:43
Re: Problem with /buyprop - by Kirollos - 10.02.2014, 02:10
Re: Problem with /buyprop - by Tayab - 10.02.2014, 02:42
Re: Problem with /buyprop - by Kirollos - 10.02.2014, 03:07
Re: Problem with /buyprop - by Tayab - 10.02.2014, 23:10

Forum Jump:


Users browsing this thread: 3 Guest(s)