11.07.2015, 05:39
Sorry for bumping. I'll post here, instead of making new topic.
I used Vince's method and the problem above is fixed now, but another problem occurs.
I'm using this code (this is a command):
NearStadium is in the player data enum, and it's false by default (when player connect).
When I enter the server (not near the stadium) and type the command, it return "you're away from the stadium", which is right.
Then when I'm standing near the stadium and enter the command it return "you're near the stadium", which is right too.
But after that, when I go away from the stadium, it always return "you're near the stadium", which is wrong.
I used Vince's method and the problem above is fixed now, but another problem occurs.
I'm using this code (this is a command):
Код:
for (new i; i < sizeof(Stadium); i++) { if (IsPlayerInRangeOfPoint(playerid, 2.5, StadiumEntrance[i][x], StadiumEntrance[i][y], StadiumEntrance[i][z])) APlayerData[playerid][NearStadium] = true; } if (APlayerData[playerid][NearStadium] == true) SendMessage(playerid, "you're near the stadium"); else SendMessage(playerid, "you're away from the stadium");
When I enter the server (not near the stadium) and type the command, it return "you're away from the stadium", which is right.
Then when I'm standing near the stadium and enter the command it return "you're near the stadium", which is right too.
But after that, when I go away from the stadium, it always return "you're near the stadium", which is wrong.