How to add a sound - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to add a sound (
/showthread.php?tid=625436)
How to add a sound -
AndreiWow - 01.01.2017
Hello guys, I script since a while but I never was interested in sounds or how to add them, but now I want to add a sound when a 911 comes in for the cops, I know how to make it only for the cops but the thing that I don't know is what site should I use to make the .mp3 file working with the script and what should I type in the script to add the song? Also If It is possible to play it without showing on the chat that there is a song playing.
Re: How to add a sound -
RyderX - 01.01.2017
Add under
PHP код:
public OnPlayerConnect(playerid)
{
PlayAudioStreamForPlayer(playerid,"Your Audio or song site");
return 1;
}
if you want it to play when someone join just.
if you want it as Command use (zcmd):
PHP код:
#include <zcmd>
CMD:music(playerid,params[])
{
PlayAudioStreamForPlayer(playerid,"Your Audio or song site");
return 1;
}
i don't thing and there's a way to hide it from main chat.
Re: How to add a sound -
GoldenLion - 01.01.2017
I'd say Dropbox is good, but no you can't hide the audio stream message, but what you can do is use PlayerPlaySound instead and play some sounds from the game, but of course if you can't find the sound you need you must play an audio stream.
Re: How to add a sound -
AndreiWow - 01.01.2017
Quote:
Originally Posted by GoldenLion
I'd say Dropbox is good, but no you can't hide the audio stream message, but what you can do is use PlayerPlaySound instead and play some sounds from the game, but of course if you can't find the sound you need you must play an audio stream.
|
How to get a song link from dropbox?
Re: How to add a sound -
GoldenLion - 01.01.2017
Quote:
Originally Posted by AndreiWow
How to get a song link from dropbox?
|
You upload the file, copy the link and replace dl=0 with dl=1 at the end of the link.
Re: How to add a sound -
AndreiWow - 01.01.2017
Can I make the sound follow a vehicle? Like make my custom police siren?
Re: How to add a sound -
SoLetsGO - 01.01.2017
Quote:
Originally Posted by AndreiWow
Can I make the sound follow a vehicle? Like make my custom police siren?
|
Check out the wiki:
https://sampwiki.blast.hk/wiki/PlayAudioStreamForPlayer
You can see that there are optional parameters:
Float
osX = 0.0, Float
osY = 0.0, Float
osZ = 0.0, Float:distance = 50.0, usepos = 0
So if you want to "attach" the music to a player then you have to make a timer and update the position.
Well, the problem would be that everytime it would show the message again.
Re: How to add a sound - iLearner - 01.01.2017
Apparently the message "streaming
http://blabal" does no longer show for me when i play a audio for players.
Re: How to add a sound -
Spmn - 01.01.2017
Quote:
Originally Posted by iLearner
Apparently the message "streaming http://blabal" does no longer show for me when i play a audio for players.
|
/audiomsg or radio volume is set to 0
Re: How to add a sound -
AndreiWow - 02.01.2017
Quote:
Originally Posted by Spmn
/audiomsg or radio volume is set to 0
|
So players can disable it?