21.02.2016, 19:24
The problem is that OnPlayerUpdate is constantly being called, so when the box is shown, the box will also be hidden on the next update if the player is still in range.
Adding checks solves this problem.
Adding checks solves this problem.
pawn Код:
public OnPlayerUpdate(playerid)
{
if(!Showing[playerid])
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 217.7364,1877.2621,13.1406))
{
Box(playerid, "Stlac LALT pre otvorenie brany.", 5);
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, 217.8487,1874.2979,13.1406))
{
Box(playerid, "Stlac LALT pre otvorenie brany.", 5);
}
}
return 1;
}