You're doing it wrong.
pawn Код:
//This doesn't need a house check as the callback itself will do it.
forward NearHouse(playerid);
public NearHouse(playerid)
{
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
for(new i = 0; i < sizeof(HouseInfo); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 4.0, HouseInfo[i][ExitX], HouseInfo[i][ExitY], HouseInfo[i][ExitZ]) && GetWorld(targetid) == GetWorld(playerid))
{
sendMessage(playerid, COLOR_DARKGREEN, "%s, %s, San Andreas", ReturnLocationEx(i));
SCM(playerid, COLOR_WHITE, "Available commands: /enter, /ds(hout), /ddo, /knock");
}
}
}
return 1;
}
//You must check the nearby house before you call this callback!
forward NearHouse(playerid, houseid);
public NearHouse(playerid, houseid)
{
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
if(IsPlayerInRangeOfPoint(playerid, 4.0, HouseInfo[houseid][ExitX], HouseInfo[houseid][ExitY], HouseInfo[houseid][ExitZ]) && GetWorld(targetid) == GetWorld(playerid))
{
sendMessage(playerid, COLOR_DARKGREEN, "%s, %s, San Andreas", ReturnLocationEx(i));
SCM(playerid, COLOR_WHITE, "Available commands: /enter, /ds(hout), /ddo, /knock");
}
}
return 1;
}