House required score
#4

Replace the buy command with this:
pawn Код:
dcmd_buyhouse(playerid,params[]) {
    #pragma unused params
    if(IsPlayerConnected(playerid)){
        for(new h = 0; h <= MAX_HOUSES; h++){
            if(PlayerToPoint(PTP_RADIUS, playerid, HouseInfo[h][hExitX], HouseInfo[h][hExitY], HouseInfo[h][hExitZ])){
                if(strcmp(HouseInfo[h][hName],GetName(playerid), false ) != 0){
                    if(HouseInfo[h][hSellable] == 1){
                        if(GetPlayerMoney(playerid) < HouseInfo[h][hSell]) return SendClientMessage(playerid, COLOR_WHITE, ".:: [HOUSE]: You do not have anough money to buy this house.");
                            if(GetPlayerScore(playerid) >=50)
                            {
                                DestroyPickup(HouseInfo[h][hPickup]);
                                HouseInfo[h][hPickup] = CreatePickup(1272,23, HouseInfo[h][hExitX], HouseInfo[h][hExitY], HouseInfo[h][hExitZ]); // bought
                                HouseInfo[h][hSellable] = 0; GivePlayerMoney(playerid, -HouseInfo[h][hSell]);
                                format(HouseInfo[h][hName], 24, "%s", GetName(playerid)); SavePlayerHouse(h);
                            }
                            else return SendclientMessage(playerid, 0xFFFFFFFF, "You need at least level 50.");
                      } else return SendClientMessage(playerid, COLOR_WHITE, ".:: [HOUSE]: This house is not for sale.");
                } else return SendClientMessage(playerid, COLOR_WHITE, ".:: [HOUSE]: You are cannot buy the house you are selling.");
            } } }
    return true;
}
Reply


Messages In This Thread
House required score - by Encyanix - 08.02.2012, 10:14
Re: House required score - by milanosie - 08.02.2012, 10:32
Re: House required score - by Encyanix - 08.02.2012, 11:25
Re : House required score - by ricardo178 - 08.02.2012, 11:29
Re: House required score - by Encyanix - 08.02.2012, 11:39
Re: House required score - by iTorran - 08.02.2012, 11:40
Re: House required score - by Encyanix - 08.02.2012, 18:00
Re: House required score - by Encyanix - 10.02.2012, 18:58
Re: House required score - by [LoF]Zak - 10.02.2012, 19:11

Forum Jump:


Users browsing this thread: 1 Guest(s)