SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 05/11/2012, 03:28 AM   #1
zDivine
Huge Clucker
 
Join Date: Oct 2012
Location: zDivine.pwn
Posts: 297
Reputation: 49
Default PlayAudioStreamForPlayer()

Is this function bugged? Because I made a boombox system and when you play the audio stream, it works fine, but then after a few seconds, it just stops playing...

I then created a simple command:
pawn Code:
CMD:playaudio(playerid, params[])
{
    if(isnull(params)) return SendClientMessage(playerid, -1, "USAGE: /playaudio [music url]");
   
    if(strlen(params) > 0)
    {
        PlayAudioStreamForPlayer(playerid, params, 0.0, 0.0, 0.0, 50.0, 0);
    }
    return 1;
}
To test the audio function to see if it was just the boombox system, and it does the exact same thing.

Any help?

EDIT: Found out it's only me that the audio stops playing for. Is there something I have to download for it to work properly?
zDivine is offline   Reply With Quote
Old 05/11/2012, 03:46 AM   #2
Glad2BeHere
Gangsta
 
Glad2BeHere's Avatar
 
Join Date: Oct 2012
Posts: 759
Reputation: 136
Default Re: PlayAudioStreamForPlayer()

use http://kiwi6.com/ what i recommend and u may wanna use sscanf 4 address, likes s[32] if typing address also u may want 2 use isplayernearplayer, and foreach so something like
pawn Code:
stock IsPlayerNearPlayer(playerid, targetid, Float:radius)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(targetid, x, y, z);
    if(IsPlayerInRangeOfPoint(playerid, radius ,x, y, z))
    {
        return 1;
    }
    return 0;
}
pawn Code:
CMD:playaudio(playerid, params[])
{
if(sscanf(params, "s[32]", params)) return SendClientMessage(playerid, -1, "USAGE: /playaudio [music url]");
foreach(Player, i)
{
if(IsPlayerNearPlayer(playerid, i, 10))
{
PlayAudioStreamForPlayer(playerid, params);
}
}
return 1;
}
pawn Code:
CMD:playaudio(playerid, params[])
{
new Float:x, Float:y,Float:z;
GetPlayerPos(playerid, x,y,z);
if(sscanf(params, "s[32]", params)) return SendClientMessage(playerid, -1, "USAGE: /playaudio [music url]");
foreach(Player, i)
{
PlayAudioStreamForPlayer(i, params,x,y,z,10,1);
}
return 1;
}
Glad2BeHere is offline   Reply With Quote
Old 05/11/2012, 03:51 AM   #3
zDivine
Huge Clucker
 
Join Date: Oct 2012
Location: zDivine.pwn
Posts: 297
Reputation: 49
Default Re: PlayAudioStreamForPlayer()

Quote:
Originally Posted by Glad2BeHere View Post
use http://kiwi6.com/ what i recommend and u may wanna use sscanf 4 address, likes s[32] if typing address also u may want 2 use isplayernearplayer, and foreach so something like
pawn Code:
stock IsPlayerNearPlayer(playerid, targetid, Float:radius)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(targetid, x, y, z);
    if(IsPlayerInRangeOfPoint(playerid, radius ,x, y, z))
    {
        return 1;
    }
    return 0;
}
pawn Code:
CMD:playaudio(playerid, params[])
{
if(sscanf(params, "s[32]", params)) return SendClientMessage(playerid, -1, "USAGE: /playaudio [music url]");
foreach(Player, i)
{
if(IsPlayerNearPlayer(playerid, i, 10))
{
PlayAudioStreamForPlayer(playerid, params);
}
}
return 1;
}
pawn Code:
CMD:playaudio(playerid, params[])
{
new Float:x, Float:y,Float:z;
GetPlayerPos(playerid, x,y,z);
if(sscanf(params, "s[32]", params)) return SendClientMessage(playerid, -1, "USAGE: /playaudio [music url]");
foreach(Player, i)
{
PlayAudioStreamForPlayer(i, params,x,y,z,10,1);
}
return 1;
}
I love how every one of your reply's to threads are of no help whatsoever...
zDivine is offline   Reply With Quote
Old 05/11/2012, 03:53 AM   #4
Glad2BeHere
Gangsta
 
Glad2BeHere's Avatar
 
Join Date: Oct 2012
Posts: 759
Reputation: 136
Default Re: PlayAudioStreamForPlayer()

u r the worst, i give u the correct cmd 2 use n u shut it down, u make no sense, i show u how 2 do things right and utube gives trouble with playaudiostreamforplayer,

if u didnt make crap for a cmd u wont be here would u?
Glad2BeHere is offline   Reply With Quote
Old 05/11/2012, 04:33 AM   #5
Drake_Lopez
Little Clucker
 
Join Date: Mar 2012
Location: Sweden
Posts: 42
Reputation: 4
Default Re: PlayAudioStreamForPlayer()

Glad2BeHere is right.. I tested it, it worked fine..
__________________




IP: 66.85.148.154:7782
Drake_Lopez is offline   Reply With Quote
Old 05/11/2012, 05:01 AM   #6
Glad2BeHere
Gangsta
 
Glad2BeHere's Avatar
 
Join Date: Oct 2012
Posts: 759
Reputation: 136
Default Re: PlayAudioStreamForPlayer()

please he copy n paste it and like damn hes good
Glad2BeHere is offline   Reply With Quote
Old 05/11/2012, 09:29 AM   #7
cosbraa
Big Clucker
 
Join Date: Apr 2012
Posts: 126
Reputation: 19
Default Re: PlayAudioStreamForPlayer()

Glad2behere, you should start typing normal.
cosbraa 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
[HELP] PlayAudioStreamForPlayer jamax Scripting Help 4 04/06/2012 10:07 AM
PlayAudioStreamForPlayer mati233 Scripting Help 4 01/06/2012 04:08 PM
PlayAudioStreamForPlayer Help! ShawnMiller1337 Scripting Help 3 05/01/2012 07:01 PM
PlayAudioStreamForPlayer help N0FeaR Scripting Help 5 30/12/2011 12:24 AM


All times are GMT. The time now is 05:42 AM.


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