26.08.2009, 15:28
Hey, I made a house system, every time a house is placed, it is assigned a unique ID (HouseID) and my /enter command is failing since I can only enter the house of HouseId 1.
The house id is also the virtual world it sets them to.
the variable "houses" is read from a file.
The house id is also the virtual world it sets them to.
pawn Код:
if(strcmp(cmd, "/enter", true) == 0)
{
for(new i = 0; i < houses; i++)
{
if(PlayerToPoint(2.0, playerid,HouseInfo[i][hHousex], HouseInfo[i][hHousey], HouseInfo[i][hHousez]))
{
SetPlayerInt(playerid,HouseInfo[i][hHouseInterior]);
SetPlayerVirtualWorld(playerid, HouseInfo[i][hHouseId]);
PlayerInfo[playerid][pInside] = 1;
GetPlayerPos(playerid, x, y, z);
PlayerInfo[playerid][pExitx] = x;
PlayerInfo[playerid][pExity] = y;
PlayerInfo[playerid][pExitz] = z;
return 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "You are not near an entrace");
return 1;
}
}
}