How to add a sound
#1

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.
Reply
#2

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.
Reply
#3

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.
Reply
#4

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?
Reply
#5

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.
Reply
#6

Can I make the sound follow a vehicle? Like make my custom police siren?
Reply
#7

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:
FloatosX = 0.0, FloatosY = 0.0, FloatosZ = 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.
Reply
#8

Apparently the message "streaming http://blabal" does no longer show for me when i play a audio for players.
Reply
#9

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
Reply
#10

Quote:
Originally Posted by Spmn
Посмотреть сообщение
/audiomsg or radio volume is set to 0
So players can disable it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)