Quote:
Originally Posted by Konstantinos
AIped is correct, there isn't any reason to use PlayerToPoint when IsPlayerInRangeOfPoint already exists.
However, there's a better option than a timer or OPU and IsPlayerInRangeOfPoint and that is dynamic areas.
pawn Код:
#include <streamer>
// global: new Area_Music;
// OnGameModeInit/OnFilterScriptInit (depends on the mode): Area_Music = CreateDynamicSphere(x, y, z, size); // Edit the arguments
public OnPlayerEnterDynamicArea(playerid, areaid) { if (areaid == Area_Music) PlayAudioStreamForPlayer(playerid,"MUSIC HERE"); return 1; }
public OnPlayerLeaveDynamicArea(playerid, areaid) { if (areaid == Area_Music) StopAudioStreamForPlayer(playerid); return 1; }
If you don't want to stop the music when the player is not anymore in the area, remove the last callback.
|
Thanks Konstantinos i didnt know that such things as ' CreateDynamicSphere ' was in a streamer...
I would use this too instead of a timer...and OnPlayerUpdate is a real no go for just this