on spawn allowing player to turn on ambient sounds. - 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: on spawn allowing player to turn on ambient sounds. (
/showthread.php?tid=583484)
on spawn allowing player to turn on ambient sounds. -
Lukasz56 - 28.07.2015
Hi there , could anyone help me out with one snippet or a code ? This is realy basic stuff . I need that whenever player spawns it should show a gui with a message if you want to play ambient sounds or no . I just need a code , i will figure out with sounds myself . Thanks
Re: on spawn allowing player to turn on ambient sounds. -
Abagail - 28.07.2015
pawn Код:
#define DIALOG_AMBIENCE 1
new bool: playerAmbience[MAX_PLAYERS];
new bool: ambienceYet[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
if(ambienceYet[playerid] == false) {
ShowPlayerDialog(playerid, DIALOG_AMBIENCE, DIALOG_STYLE_MSGBOX, "Ambience Sounds", "Do you want to play ambient sounds?", "Yes", "No");
ambienceYet[playerid] = true;
} return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_AMBIENCE) {
if(response) playerAmbience[playerid] = true;
else playerAmbience[playerid] = false; }
return 1;
}
Re: on spawn allowing player to turn on ambient sounds. -
Evocator - 28.07.2015
Meh, seems giving a code is better than explaining now.
Re: on spawn allowing player to turn on ambient sounds. -
Lukasz56 - 28.07.2015
Where should i put the stream link if player pressed the "yes" button . Btw thanks for helping out +rep m8
Re: on spawn allowing player to turn on ambient sounds. -
Abagail - 28.07.2015
pawn Код:
if(response)
{
playerAmbience[playerid] = true;
PlayAudioStreamForPlayer(playerid, "yoursong.mp3");
return 1;
}