Selling all houses
#1

Is this script correct?

pawn Код:
CMD:sellallhouses(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin] >= 99999)
    {
        for (new HouseID = 0; HouseID < MAX_HOUSES; HouseID++)
        ClearHouse(HouseID);
        HouseInfo[HouseID][hGLUpgrade] = 1;
        return 1;
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use that command!");
    }
    return 1;
}
if not please tellme whats wrong / give me script fixed
Reply
#2

Your for loop inside the if() is missing brackets encasing the functions. You also won't need the return 1; since you have one at the end of the function.
Reply
#3

Quote:
Originally Posted by nemesis-
Посмотреть сообщение
Your for loop inside the if() is missing brackets encasing the functions. You also won't need the return 1; since you have one at the end of the function.
this.
pawn Код:
CMD:sellallhouses(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin] >= 99999)
    {
        for (new HouseID = 0; HouseID < MAX_HOUSES; HouseID++)
        {
        ClearHouse(HouseID);
        HouseInfo[HouseID][hGLUpgrade] = 1;
        }
        return 1;
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use that command!");
    }
    return 1;
}
also I think that you need to check if the houseID is an invalid ID or not, it's better than doing that even for unsued House slots.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)