OnPlayerDeath Audio Streams Problem
#1

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;
}
Reply
#2

I don't think you can play .wav files via PlayAudioStreamForPlayer
Try converting the files to MP3 and then try.
Reply
#3

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

Also;
pawn Код:
SetPlayerScore(killerid, 1);
Your setting there score to one everytime they get a kill

pawn Код:
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
Reply
#5

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

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);
?
Reply
#7

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)