#include <a_samp> new OneTimeOnly[MAX_PLAYERS]; public OnPlayerUpdate(playerid) { if(OneTimeOnly[playerid] == 0) { if(IsPlayerConnected(playerid) && IsPlayerInRangeOfPoint(playerid, 1, -2141.1802, -151.0720, 35.3359)) { PlayAudioStreamForPlayer(playerid, "http://dl3.bia2rap20.info/Full/Fadaei/Fadaei_Hamseda_64.mp3"); OneTimeOnly[playerid] = 1; } } else { if(IsPlayerConnected(playerid) && IsPlayerInRangeOfPoint(playerid, 1, -2141.1885, -156.1039, 35.3203)) { StopAudioStreamForPlayer(playerid); } } return 1; }
#include <a_samp> new OneTimeOnly[MAX_PLAYERS]; public OnPlayerUpdate(playerid) { if(OneTimeOnly[playerid] == 0) { if(IsPlayerConnected(playerid) && IsPlayerInRangeOfPoint(playerid, 1, -2141.1802, -151.0720, 35.3359)) { PlayAudioStreamForPlayer(playerid, "http://dl3.bia2rap20.info/Full/Fadaei/Fadaei_Hamseda_64.mp3"); OneTimeOnly[playerid] = 1; } } else { if(IsPlayerConnected(playerid) && IsPlayerInRangeOfPoint(playerid, 1, -2141.1885, -156.1039, 35.3203)) { StopAudioStreamForPlayer(playerid); OneTimeOnly[playerid] = 0; } } return 1; }
You forgot to set the OneTimeOnly back to 0 again, I think.
Код:
#include <a_samp> new OneTimeOnly[MAX_PLAYERS]; public OnPlayerUpdate(playerid) { if(OneTimeOnly[playerid] == 0) { if(IsPlayerConnected(playerid) && IsPlayerInRangeOfPoint(playerid, 1, -2141.1802, -151.0720, 35.3359)) { PlayAudioStreamForPlayer(playerid, "http://dl3.bia2rap20.info/Full/Fadaei/Fadaei_Hamseda_64.mp3"); OneTimeOnly[playerid] = 1; } } else { if(IsPlayerConnected(playerid) && IsPlayerInRangeOfPoint(playerid, 1, -2141.1885, -156.1039, 35.3203)) { StopAudioStreamForPlayer(playerid); OneTimeOnly[playerid] = 0; } } return 1; } |