11.07.2015, 06:29
Quote:
PHP код:
You're calling the ELSE statement every single time right? So lets say you have... 10 Inside your array.. You're going to get 10 messages... The code Posted above should work. |
The problem wasn't spamming with messages. There's break; in the code, which will prevent the spam.
The problem now is this:
Quote:
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. |