/enter command not checking positions.
#1

Hello. I made a /enter command for my house system.. Will make it for all soon, but now..
The problem is that it tells i am not near any house, even if i do.

pawn Code:
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]);
                return 1;
            }
            else return SendClientMessage(playerid, 0xFFFFFFFF, "This house is locked.");
        }
        else return SendClientMessage(playerid, 0xFFFFFFFF, "You are not near a house.");
    }
    return 1;
}
Tried all... Also tried make a command to laod HouseInfo.. the LoadHouses is like that:
pawn Code:
//LoadHouses
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;
}
Reply


Messages In This Thread
/enter command not checking positions. - by ricardo178 - 18.02.2012, 22:03
Re: /enter command not checking positions. - by milanosie - 18.02.2012, 22:10
Re : /enter command not checking positions. - by ricardo178 - 18.02.2012, 22:11
Re: /enter command not checking positions. - by Vince - 18.02.2012, 22:22
Re: /enter command not checking positions. - by IceCube! - 18.02.2012, 22:24
Re: /enter command not checking positions. - by milanosie - 18.02.2012, 22:27
Re: /enter command not checking positions. - by Kwarde - 18.02.2012, 22:34
Re: /enter command not checking positions. - by Vince - 18.02.2012, 22:38
Re: /enter command not checking positions. - by milanosie - 18.02.2012, 22:39
Re: /enter command not checking positions. - by milanosie - 18.02.2012, 22:41

Forum Jump:


Users browsing this thread: 1 Guest(s)