Help please ;)
#10

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
Reply


Messages In This Thread
Help please ;) - by BarFix - 07.01.2014, 14:18
Re: Help please ;) - by ScRipTeRi - 07.01.2014, 14:20
Re: Help please ;) - by AIped - 07.01.2014, 14:21
Re: Help please ;) - by BarFix - 07.01.2014, 14:24
Re: Help please ;) - by ScRipTeRi - 07.01.2014, 14:25
Re: Help please ;) - by AIped - 07.01.2014, 14:28
Re: Help please ;) - by BarFix - 07.01.2014, 14:29
Re: Help please ;) - by offon - 07.01.2014, 14:34
Re: Help please ;) - by Konstantinos - 07.01.2014, 14:36
Re: Help please ;) - by AIped - 07.01.2014, 14:51

Forum Jump:


Users browsing this thread: 3 Guest(s)