Need help
#1

I make a one event place
I want that if someone come there automatically songs play
Please guide me how i set that

This is codes of that place

Код:
CreateObject(19128, 842.67010, -2049.13647, 11.67430,   0.00000, -92.00000, 269.15125);
Help me pls

I want to play this song there
http://www.woo55.com/adata/11069/ow59LUN3ODCf.129.mp3
Reply
#2

Try this :
Reply
#3

Try by yourself first.
1) Use OnPlayerUpdate callback.
2) https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint (Detect if the player in custom area.)
3) https://sampwiki.blast.hk/wiki/PlayAudioStreamForPlayer (Player audio for him.)
Reply
#4

pawn Код:
PlayAudioStreamForPlayer(playerid, "http://www.woo55.com/adata/11069/ow59LUN3ODCf.129.mp3", 842.67010, -2049.13647, 11.67430, 100.0, 1);
Mixed with IsPlayerInRangeOfPoint
Reply
#5

Can you provide me full code
Please
Like israngeplayerpoint and playaudiostream pls
Reply
#6

Quote:
Originally Posted by OssiBaba
Посмотреть сообщение
Can you provide me full code
Please
Like israngeplayerpoint and playaudiostream pls
pawn Код:
public OnGameModeInit()
{
    PlayAudioStreamForPlayer(playerid, "http://www.woo55.com/adata/11069/ow59LUN3ODCf.129.mp3", 842.67010, -2049.13647, 11.67430, 100.0, 1);
    return 1;
}
Reply
#7

This section for people who got some problems with their script. by the way i hope you learn.
pawn Код:
public OnPlayerUpdate(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 20.0, 842.67010, -2049.13647, 11.67430))
    {
    PlayAudioStreamForPlayer(playerid, "http://www.woo55.com/adata/11069/ow59LUN3ODCf.129.mp3", 842.67010, -2049.13647, 11.67430, 100.0, 1);
    }
    return 1;
}
Reply
#8

Quote:
Originally Posted by SilentSoul
Посмотреть сообщение
This section for people who got some problems with their script. by the way i hope you learn.
pawn Код:
public OnPlayerUpdate(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 20.0, 842.67010, -2049.13647, 11.67430))
    {
    PlayAudioStreamForPlayer(playerid, "http://www.woo55.com/adata/11069/ow59LUN3ODCf.129.mp3", 842.67010, -2049.13647, 11.67430, 100.0, 1);
    } else return StopAudioStreamForPlayer(playerid);
    return 1;
}
This will good ?

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 20.0, 842.67010, -2049.13647, 11.67430))
    {
        PlayAudioStreamForPlayer(playerid, "http://www.woo55.com/adata/11069/ow59LUN3ODCf.129.mp3");
    } else return StopAudioStreamForPlayer(playerid); // <<< Will make when the player not on the event place the music will auto stoped !
    return 1;
}
Reply
#9

Quote:
Originally Posted by SilentSoul
Посмотреть сообщение
This section for people who got some problems with their script. by the way i hope you learn.
pawn Код:
public OnPlayerUpdate(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 20.0, 842.67010, -2049.13647, 11.67430))
    {
    PlayAudioStreamForPlayer(playerid, "http://www.woo55.com/adata/11069/ow59LUN3ODCf.129.mp3", 842.67010, -2049.13647, 11.67430, 100.0, 1);
    }
    return 1;
}
Quote:
Originally Posted by VenomMancer
Посмотреть сообщение
This will good ?

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 20.0, 842.67010, -2049.13647, 11.67430))
    {
        PlayAudioStreamForPlayer(playerid, "http://www.woo55.com/adata/11069/ow59LUN3ODCf.129.mp3");
    } else return StopAudioStreamForPlayer(playerid); // <<< Will make when the player not on the event place the music will auto stoped !
    return 1;
}
That will play every time OnPlayerUpdate gets called, I suggest using streamer and use OnPlayerEnter/ExitDynamicArea
Reply
#10

Код:
public OnPlayerUpdate(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 20.0, 842.67010, -2049.13647, 11.67430)) 
    {
        PlayAudioStreamForPlayer(playerid, "http://www.woo55.com/adata/11069/ow59LUN3ODCf.129.mp3");
    } else return StopAudioStreamForPlayer(playerid); // <<< Will make when the player not on the event place the music will auto stoped !
    return 1;
}
I am using this codes but songs play 3-9 times and no one understand the song
I mean songs are playing at a time 5 times
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)