Making Stream And Stop Stream Commands -
dh240473 - 17.09.2015
Hi Guys Today I'm Going To Make A Tutorial How To Making A Stream And Stop Stream Commands
1.Sorry For My Bad English
2.You Need Put A Commands
PHP код:
CMD:stream(playerid, params[])
{
return 1;
}
CMD:stopstream(playerid, params[])
{
return 1;
}
Like That
3.You Need The Put Function Of That Commands
PHP код:
CMD:stream(playerid, params[])
{
new string[128];
if(isnull(params)) return SendClientMessage(playerid, LIGHT_RED, "USAGE: /stream [Url]");//error message if the params is nothing
new HighestPlayerId = GetPlayerPoolSize();
for(new x=0; x <= HighestPlayerId; x++) { // (note the condition change from < to <=)
if(!IsPlayerConnected(x)) continue;//only for connected player
format(string, sizeof(string), "[DJ]%s(%d)Has Been Stream The Best Music", IsPlayerName(playerid), playerid);//A Message To Send For All Player
SendClientMessage(x, 0x00FFFFFF, string);//A Function To Send The Message
PlayAudioStreamForPlayer(x, params);//Make The Music Are Played!
}
}
return 1;
}
CMD:stopstream(playerid, params[])
{
StopAudioStreamForPlayer(playerid);//Stop The Music
return 1;
}
4.You Only Can Stream The Url Got .mp3 At Back Example:
http://musicjustfor.me/assets/songs/...1440819845.mp3
5.If You're Think The Url Are Too Long You Need To Short It Using
http://bit.do Or
http://******* Or
Http://*******
6.Compile And Enjoy The Script!
Re: Making Stream And Stop Stream Commands -
xTURBOx - 17.09.2015
use [code] or [php] tags next time.
Код:
CMD:stream(playerid,params[])
turned into

EDIT: thanks you corrected it
Re: Making Stream And Stop Stream Commands -
dh240473 - 17.09.2015
Quote:
Originally Posted by xTURBOx
use [code] or [php] tags next time.
Код:
CMD:stream(playerid,params[])
turned into 
|
Already Bro Anyway Thanx for the tips
Re: Making Stream And Stop Stream Commands -
J0sh... - 17.09.2015
MAX_PLAYER loops?
shudders
Re: Making Stream And Stop Stream Commands -
dh240473 - 17.09.2015
Quote:
Originally Posted by Jamester
MAX_PLAYER loops? shudders
|
Yes It Is
Re: Making Stream And Stop Stream Commands -
Ahmad45123 - 17.09.2015
Dude.. Don't use MAX_PLAYERS... Its not used anymore.. You should update yourself.
If you'd read the updates here:
https://sampforum.blast.hk/showthread.php?tid=559572
You would see that it has been changed to:
PHP код:
new HighestPlayerId = GetPlayerPoolSize();
for(new x=0; x <= HighestPlayerId; x++) { // (note the condition change from < to <=)
if(IsPlayerConnected(x)) { // do stuff with a player id
}
}
Also I REPed you because u most likely created this for reps and also for your effort

But please try to release correct stuff next time and don't teach people wrong ways.
Re: Making Stream And Stop Stream Commands -
dh240473 - 17.09.2015
Quote:
Originally Posted by Ahmad45123
Dude.. Don't use MAX_PLAYERS... Its not used anymore.. You should update yourself.
If you'd read the updates here: https://sampforum.blast.hk/showthread.php?tid=559572
You would see that it has been changed to:
PHP код:
new HighestPlayerId = GetPlayerPoolSize(); for(new x=0; x <= HighestPlayerId; x++) { // (note the condition change from < to <=) if(IsPlayerConnected(x)) { // do stuff with a player id } }
Also I REPed you because u most likely created this for reps and also for your effort 
But please try to release correct stuff next time and don't teach people wrong ways.
|
Ok,Thx For The Guide Srsly I'm Not Checking The Update

Just Wanna Share The Script

And Let Everyone Know The Script Nvm I Will Fix The Code
Re: Making Stream And Stop Stream Commands -
HydraHumza - 18.09.2015
You isn't mention include of zcmd