#1

Hey, i dont know how to make something like that. If player is in range of point it's streaming music for him. It's same like boombox but without commands. Anyone know how to do that?
Reply
#2

Код:
new OneTimeOnly[MAX_PLAYERS];

public OnPlayerUpdate(playerid)
{
   if(OneTimeOnly[playerid] == 0)
   {
      if(IsPlayerConnected(playerid) && IsPlayerInRangeOfPoint(playerid, range, x, y, z))
      {
         PlayAudioStreamForPlayer(playerid, www.music.com);
         OneTimeOnly[playerid] = 1;
      }
   }
   return 1;
}
Reply
#3

Can You please put it in filterscript? After including it into my gamemode i got shitload of errors.
Reply
#4

here you go
Reply
#5

Yeah man, thanks a lot! +Rep

But i have one more question.
How can I put few positions and few links?
I mean one positions = one link
Reply
#6

And what to do to stop music after leaving this area?
Reply
#7

Is that good?

Код:
#include <a_samp>

new OneTimeOnly[MAX_PLAYERS];


public OnPlayerUpdate(playerid)
{
   if(OneTimeOnly[playerid] == 0)
   {
      if(IsPlayerConnected(playerid) && IsPlayerInRangeOfPoint(playerid, 20.0, x, y, z)
      {
         PlayAudioStreamForPlayer(playerid, "link");
         OneTimeOnly[playerid] = 1;
         }
    	else
    	{
        StopAudioStreamForPlayer(playerid);
    	}
      if(IsPlayerConnected(playerid) && IsPlayerInRangeOfPoint(playerid, 20.0, x, y, z))
      {
         PlayAudioStreamForPlayer(playerid, "link");
         OneTimeOnly[playerid] = 1;
      }
      if(IsPlayerConnected(playerid) && IsPlayerInRangeOfPoint(playerid, 20.0, x, y, z)
      {
         PlayAudioStreamForPlayer(playerid, "link");
         OneTimeOnly[playerid] = 1;
      }
      if(IsPlayerConnected(playerid) && IsPlayerInRangeOfPoint(playerid, 20.0, x, y, z)
      {
         PlayAudioStreamForPlayer(playerid, "link");
         OneTimeOnly[playerid] = 1;
      }
      if(IsPlayerConnected(playerid) && IsPlayerInRangeOfPoint(playerid, 20.0, x, y, z))
      {
         PlayAudioStreamForPlayer(playerid, "link");
         OneTimeOnly[playerid] = 1;
      }
   }
   return 1;
}
Reply
#8

Try doing it with the dynamic area feature of the streamer plugin. OnPlayerUpdate doesn't seem quite fit for this purpose.
Reply
#9

I don't know how to stop stream after leaving area.
Reply
#10

Quote:
Originally Posted by Vince
Посмотреть сообщение
Try doing it with the dynamic area feature of the streamer plugin. OnPlayerUpdate doesn't seem quite fit for this purpose.
CreateDynamicSphere, OnPlayerEnterDynamicArea, OnPlayerLeaveDynamicArea.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)