SelfMade /enter not working. [Rep+]
#1

Hello. I made this /enter command for my house system, but it is not working.. It simply says i am not near any house when i am..

pawn Код:
CMD:enter(playerid, params[])
{
    for(new i = 0; i < sizeof(HouseInfo); i++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 10.0, HouseInfo[i][X], HouseInfo[i][Y], HouseInfo[i][Z]))
        {
            if(HouseInfo[i][Lock] == 0)
            {
                SetPlayerPos(playerid, HouseInfo[i][IntX], HouseInfo[i][IntY], HouseInfo[i][IntZ]);
                SetPlayerInterior(playerid, HouseInfo[i][Int]);
                SetPlayerVirtualWorld(playerid, HouseInfo[i][Vw]);
            }
            else return SendClientMessage(playerid, 0xFFFFFFFF, "This house is locked.");
        }
        else return SendClientMessage(playerid, 0xFFFFFFFF, "You are not near a house.");
    }
    return 1;
}
The load houses:
pawn Код:
forward LoadHouses();
public LoadHouses()
{
    for(new i = 1; i < sizeof(HouseInfo); i++)
    {
        format(file, sizeof(file), "RRP/houses/%d.ini", i);
        if(fexist(file))
        {
            HouseInfo[i][X] = dini_Int(file, "X");
            HouseInfo[i][Y] = dini_Int(file, "Y");
            HouseInfo[i][Z] = dini_Int(file, "Z");
            HouseInfo[i][Int] = dini_Int(file, "Int");
            HouseInfo[i][Vw] = dini_Int(file, "Vw");
            HouseInfo[i][Owner] = dini_Int(file, "Owner");
            HouseInfo[i][Lock] = dini_Int(file, "Lock");
            HouseInfo[i][Price] = dini_Int(file, "Price");
            HouseInfo[i][IntX] = dini_Int(file, "IntX");
            HouseInfo[i][IntY] = dini_Int(file, "IntY");
            HouseInfo[i][IntZ] = dini_Int(file, "IntZ");
        }
    }
    print("[RRP]: Houses Loadeds");
    return 1;
}
Thank you.
Reply
#2

Fixed it, by changing 0 to 1 in for.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)