Loose indentation, what do i do?
#4

Well, heres the command, but i didnt fully include the whole code of it, as i spend a lot of time making it and don't want others to use it:
pawn Код:
CMD:buyhouse(playerid, params[])
{
    for(new hi = 0; hi < sizeof(HInfo); hi++)
    {
    if(IsPlayerInRangeOfPoint(playerid, 3, HInfo[hi][heX],HInfo[hi][heY],HInfo[hi][heZ]))
    {
        if(!strcmp(HInfo[hi][hOwnedBy], "None") || HInfo[hi][hForSale] == 1)
        {
            if(pInfo[playerid][Logged] == 0)
            {
                SendClientMessage(playerid, COLOR_RED, "You are not logged in!");
                return 1;
            }
            else //Can purchase it.
            {
                if(pInfo[playerid][pHouse1] > 0 && pInfo[playerid][pHouse2] > 0) { SendClientMessage(playerid, COLOR_RED, "You cannot have more than 2 houses!"); return 1; }
                if(pInfo[playerid][pHouse1] == 0)
                {
                    if(!strcmp(HInfo[hi][hOwnedBy], "None"))
                    {
                        if(HInfo[hi][hDefaultPrice] > pInfo[playerid][pMoney])
                        {
                            SendClientMessage(playerid, COLOR_RED, "You cannot afford to purchase this house!");
                            return 1;
                        }
                        return 1;
                    }
                    if(HInfo[hi][hPrice] > pInfo[playerid][pMoney])
                    {
                        SendClientMessage(playerid, COLOR_RED, "You cannot afford to purchase this house!");
                        return 1;
                    }
                    if(isonline == 1) //he is online
                    {
                        new CHECKNAME[MAX_PLAYER_NAME];
                        for(new i = 0; i<MAX_PLAYERS; i++)
                        {
                            GetPlayerName(i, CHECKNAME, MAX_PLAYER_NAME);
                            if(!strcmp(CHECKNAME, HInfo[hi][hOwnedBy]))
                            {
                                if(IsHouse1 == 0 && IsHouse2 == 0) //CANCEL HOUSE PURCHASE.
                                {
                                    SendClientMessage(playerid, COLOR_RED, "An unknown error occured while fetching house owners data.");
                                    return 1;
                                }
                                if(IsHouse1 == 1)
                                {
                                    return 1;
                                }
                                else if(IsHouse2 == 1)
                                {
                                    return 1;
                                }
                            }
                        }
                    }
                    else //he is offline
                    {
                        if(house1id == hi)
                        {
                            return 1;
                        }
                        else
                        {
                            if(house2id == hi)
                            {
                                return 1;
                            }
                            else
                            {
                                SendClientMessage(playerid, COLOR_RED, "An error occured getting the current house owners data.");
                                return 1;
                            }
                        }
                    }
                }
                if(pInfo[playerid][pHouse2] == 0)
                {
                    if(!strcmp(HInfo[hi][hOwnedBy], "None"))
                    {
                        if(HInfo[hi][hDefaultPrice] > pInfo[playerid][pMoney])
                        {
                            SendClientMessage(playerid, COLOR_RED, "You cannot afford to purchase this house!");
                            return 1;
                        }
                        return 1;
                    }
                    if(HInfo[hi][hPrice] > pInfo[playerid][pMoney])
                    {
                        SendClientMessage(playerid, COLOR_RED, "You cannot afford to purchase this house!");
                        return 1;
                    }
                    {
                        {
                            {
                                {
                                    SendClientMessage(playerid, COLOR_RED, "An unknown error occured while fetching house owners data.");
                                    return 1;
                                }
                                if(IsHouse1 == 1)
                                {
                                    return 1;
                                }
                                else if(IsHouse2 == 1)
                                {
                                    return 1;
                                }
                            }
                        }
                    }
                    else //he is offline
                    {
                        if(house1id == hi)
                        {
                            return 1;
                        }
                        else
                        {
                            {
                                return 1;
                            }
                            else
                            {
                                SendClientMessage(playerid, COLOR_RED, "An error occured getting the current house owners data.");
                                return 0;
                            }
                        }
                    }
                }
            }
        }
    }
    return 1;
}
CMD:reloadhouses(playerid, params[])
{
    if(pInfo[playerid][pAdmin] >= 6)
    {
        for(new i=0;i<MAX_HOUSES;i++)
        {
            ReloadHouse(i);
        }
        SendClientMessage(playerid, COLOR_WHITE, "You have reloaded all houses.");
        AdminLog(playerid, "/reloadhouses", "Reloaded Houses", "Houses");
        return 1;
    }
    else
    {
        return 0;
    }
    return 1;
}
*I only removed the things inside the brackets and stuff, nothing else.*
Reply


Messages In This Thread
Loose indentation, what do i do? - by Jimmy0wns - 02.01.2014, 13:38
Re: Loose indentation, what do i do? - by Dignity - 02.01.2014, 13:46
Re: Loose indentation, what do i do? - by EiresJason - 02.01.2014, 13:48
Re: Loose indentation, what do i do? - by Jimmy0wns - 02.01.2014, 13:55
Re: Loose indentation, what do i do? - by Hansrutger - 02.01.2014, 13:57
Re: Loose indentation, what do i do? - by Konstantinos - 02.01.2014, 13:59
Re: Loose indentation, what do i do? - by Jimmy0wns - 02.01.2014, 14:02
Re: Loose indentation, what do i do? - by Pottus - 02.01.2014, 14:06
Re: Loose indentation, what do i do? - by Jimmy0wns - 02.01.2014, 15:01

Forum Jump:


Users browsing this thread: 2 Guest(s)