SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 11/06/2012, 03:15 PM   #1
Rg-Gaming.Info
Huge Clucker
 
Rg-Gaming.Info's Avatar
 
Join Date: Jan 2012
Location: Europe
Posts: 231
Reputation: 10
Default How to play random streams ?

Hey guys i have a very cool idea about my gamemode but i need to know how can i play random audio streams ? Anyone can help me ?
Rg-Gaming.Info is offline   Reply With Quote
Old 11/06/2012, 03:19 PM   #2
[MG]Dimi
High-roller
 
[MG]Dimi's Avatar
 
Join Date: Mar 2011
Location: Serbia
Posts: 1,299
Reputation: 144
Default Re: How to pay random streams ?

First you need to choose which streams and then to take random of them. You can't play any random stream since 99.999999% of possible streaming URLs are invalid.

EDIT: Yes you can play mp3. Upload it and play it.
__________________
Scripting Admin/Account/VIP Systems for $$$ using ZCMD,dcmd, Dini, MySQL and sscanf.Scripting IRC Systems with all possible functions. (Echo channels, Chat channels, Admin channels...)Long time Experience with IRC Systems.For both offers PM me
Mini Games ServerServer IP:178.238.236.62:7777
[MG]Dimi is offline   Reply With Quote
Old 11/06/2012, 03:19 PM   #3
Stevee
Little Clucker
 
Join Date: Feb 2012
Location: United Kingdom
Posts: 36
Reputation: 6
Default Re: How to pay random streams ?

You can indeed play a MP3, though I don't know how to randomly play them, my guess would be randomly select one from an array of them using a timer of some sort?
Stevee is offline   Reply With Quote
Old 11/06/2012, 03:21 PM   #4
jamax
Little Clucker
 
Join Date: May 2012
Posts: 26
Reputation: 0
Default Re: How to pay random streams ?

can we use like the url like gamemodename/scriptfiles/audio/blabla.mp3
__________________
Wisit my Balkan Server West-Balkan RP/DM

jamax is offline   Reply With Quote
Old 11/06/2012, 03:22 PM   #5
Rg-Gaming.Info
Huge Clucker
 
Rg-Gaming.Info's Avatar
 
Join Date: Jan 2012
Location: Europe
Posts: 231
Reputation: 10
Default Re: How to pay random streams ?

Quote:
Originally Posted by [MG]Dimi View Post
First you need to choose which streams and then to take random of them. You can't play any random stream since 99.999999% of possible streaming URLs are invalid.

EDIT: Yes you can play mp3. Upload it and play it.
No i think you didn't get what i ment... i meen i have my own uploaded sounds and i want to randomly play them when player dies. Whoops also sorry for the mistake in the name of the topic. Fixed it.
Rg-Gaming.Info is offline   Reply With Quote
Old 11/06/2012, 03:29 PM   #6
[MG]Dimi
High-roller
 
[MG]Dimi's Avatar
 
Join Date: Mar 2011
Location: Serbia
Posts: 1,299
Reputation: 144
Default Re: How to play random streams ?

Like this:
pawn Code:
public OnPlayerDeath(playerid,killerid,reason)
{
    new url[120];
    switch(random(5))
    {
        case 0: url="...";
        case 1: url="...";
        case 2: url="...";
        case 3: url="...";
        case 4: url="..."; //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);
    return 1;
}
__________________
Scripting Admin/Account/VIP Systems for $$$ using ZCMD,dcmd, Dini, MySQL and sscanf.Scripting IRC Systems with all possible functions. (Echo channels, Chat channels, Admin channels...)Long time Experience with IRC Systems.For both offers PM me
Mini Games ServerServer IP:178.238.236.62:7777
[MG]Dimi is offline   Reply With Quote
Old 11/06/2012, 03:31 PM   #7
nickdodd25
Huge Clucker
 
nickdodd25's Avatar
 
Join Date: Jan 2012
Location: Unknown
Posts: 337
Reputation: 40
Default Re: How to play random streams ?

Well to play randomly the easyest way for me to do it would be to make an array to hold the urls for the streams. Then in your case, when the player dies, make it pick a random stream.

EDIT:Instead of a array [MG]Dimi's would work too

And as for sound clips you can upload any sounds you want here http://kiwi6.com/ and then copy the hotlink and it will stream for you.
__________________
Nick

Team Shrimp Teamspeak

Team Shrimp, Why settle for anything less?

Last edited by nickdodd25; 11/06/2012 at 03:32 PM. Reason: change
nickdodd25 is offline   Reply With Quote
Old 11/06/2012, 03:32 PM   #8
Rg-Gaming.Info
Huge Clucker
 
Rg-Gaming.Info's Avatar
 
Join Date: Jan 2012
Location: Europe
Posts: 231
Reputation: 10
Default Re: How to play random streams ?

Quote:
Originally Posted by [MG]Dimi View Post
Like this:
pawn Code:
public OnPlayerDeath(playerid,killerid,reason)
{
    new url[120];
    switch(random(5))
    {
        case 0: url="...";
        case 1: url="...";
        case 2: url="...";
        case 3: url="...";
        case 4: url="..."; //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);
    return 1;
}
Ohh thank you very much i will give you credit for this function after i release my Version 2 of BFTDM.
Rg-Gaming.Info is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vehicle still streams in when the interior is different leong124 Bug Reports 13 28/04/2012 03:23 PM
Help With Streams & Towing Dennis_Smith Scripting Help 1 18/03/2012 09:11 PM
Audio Streams Infamous Scripting Help 2 13/03/2012 02:34 PM
Disable Audio Streams Memoryz Client Support 6 01/03/2012 03:09 AM


All times are GMT. The time now is 06:47 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.