30.12.2012, 22:21
(
Последний раз редактировалось Threshold; 30.12.2012 в 22:29.
Причина: Notepad put indentation off a little
)
Give this a shot:
I have a feeling that "if(h == -1) return 1" may have been stopping the code from reaching the second range.
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_SECONDARY_ATTACK)
{
new h = GetClosetHouseID(playerid);
if(h != -1)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, House[h][ExitX],House[h][ExitY],House[h][ExitZ]))
{
SetPlayerPos(playerid,House[h][EnterX],House[h][EnterY],House[h][EnterZ]);
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
return 1;
}
}
h = GetClosetHouseIntID(playerid);
if(h != -1)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, House[h][EnterX],House[h][EnterY],House[h][EnterZ]))
{
if(House[h][On_Sell] != 0 || House[h][Lock] != 0) return SCM(playerid,COLOR_RED,"ERROR: "COL_WHITE"House is locked/Is not for sale.");
SetPlayerPos(playerid,House[h][ExitX],House[h][ExitY],House[h][ExitZ]);
SetPlayerInterior(playerid,House[h][IntID]);
SetPlayerVirtualWorld(playerid,House[h][VW]);
if(strcmp(House[h][Owner],GetName(playerid),false) == 0)
{
new Year, Month, Day;
getdate(Year, Month, Day);
House[h][DayEnter] = Day;
House[h][MonthEnter] = Month;
CheckHouse(h);
}
}
}
}
return 1;
}

