OnPlayerDeath Audio Streams Problem - 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: OnPlayerDeath Audio Streams Problem (
/showthread.php?tid=350190)
OnPlayerDeath Audio Streams Problem -
Rg-Gaming.Info - 11.06.2012
Okay so i got the function but something is bugged i don't get to hear the sounds that i told the function to stream. Any idea why it's not working ?
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
if(killerid != INVALID_PLAYER_ID)
{
new url[120];
switch(random(5))
{
// The One Who Kills You Should Hear One Of Those Each Time
case 0: url="http://bigflashgaming.net/sounds/godlike.wav";
case 1: url="http://bigflashgaming.net/sounds/headshot.wav";
case 2: url="http://bigflashgaming.net/sounds/multikill.wav";
case 3: url="http://bigflashgaming.net/sounds/killingspree.wav";
case 4: url="http://bigflashgaming.net/sounds/monsterkil.wav";
case 5: url="http://bigflashgaming.net/sounds/rampage.wav";
case 6: url="http://bigflashgaming.net/sounds/ultrakill.wav";
case 7: url="http://bigflashgaming.net/sounds/humiliation.wav";
}
PlayAudioStreamForPlayer(playerid,url,0.0,0.0,0.0,0.0,0);
SetPlayerScore(killerid, 1);
}
new url[120];
switch(random(5))
{
// When you suicide or get killed you supose to hear those.
case 0: url="http://bigflashgaming.net/sounds/oneandonly.wav";
case 1: url="http://bigflashgaming.net/sounds/maytheforce.wav"; //your URLs in these fields. Add more or less depends of number of your sounds.
}
PlayAudioStreamForPlayer(playerid,url,0.0,0.0,0.0,0.0,0);
SetPlayerScore(playerid, -1);
return 1;
}
Re: OnPlayerDeath Audio Streams Problem -
sniperwars - 11.06.2012
I don't think you can play .wav files via PlayAudioStreamForPlayer
Try converting the files to MP3 and then try.
Re: OnPlayerDeath Audio Streams Problem -
Rg-Gaming.Info - 11.06.2012
Quote:
Originally Posted by sniperwars
I don't think you can play .wav files via PlayAudioStreamForPlayer
Try converting the files to MP3 and then try.
|
I sure can. It worked last time i compiled it because when i go to /dm it plays the stream...
Anyone got a better answer ?
Re: OnPlayerDeath Audio Streams Problem -
Elysian` - 11.06.2012
Also;
pawn Код:
SetPlayerScore(killerid, 1);
Your setting there score to one everytime they get a kill
pawn Код:
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
Re: OnPlayerDeath Audio Streams Problem -
Rg-Gaming.Info - 11.06.2012
Quote:
Originally Posted by Windows32
Also;
pawn Код:
SetPlayerScore(killerid, 1);
Your setting there score to one everytime they get a kill
pawn Код:
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
|
Ohh i didn't saw that, fixing it... do you know anything about the streams ?
Re: OnPlayerDeath Audio Streams Problem -
ryansheilds - 11.06.2012
Quote:
// The One Who Kills You Should Hear One Of Those Each Time
|
So shouldn't it be:
pawn Код:
PlayAudioStreamForPlayer(killerid,url,0.0,0.0,0.0,0.0,0);
Rather than:
pawn Код:
PlayAudioStreamForPlayer(playerid,url,0.0,0.0,0.0,0.0,0);
?
Re: OnPlayerDeath Audio Streams Problem -
Rg-Gaming.Info - 11.06.2012
Quote:
Originally Posted by ryansheilds
So shouldn't it be:
pawn Код:
PlayAudioStreamForPlayer(killerid,url,0.0,0.0,0.0,0.0,0);
Rather than:
pawn Код:
PlayAudioStreamForPlayer(playerid,url,0.0,0.0,0.0,0.0,0);
?
|
wtf im soo blind -____________________- that was big fail i feel so embarrassed