22.02.2012, 19:22
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..
The load houses:
Thank you.
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;
}
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;
}