[Tutorial] Making Stream And Stop Stream Commands
#1

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(playeridparams[])
{
    return 
1;
}
CMD:stopstream(playeridparams[])
{
    return 
1;

Like That
3.You Need The Put Function Of That Commands
PHP код:
CMD:stream(playeridparams[])
{
    new 
string[128];
    if(
isnull(params)) return SendClientMessage(playeridLIGHT_RED"USAGE: /stream [Url]");//error message if the params is nothing
    
new HighestPlayerId GetPlayerPoolSize();
for(new 
x=0<= HighestPlayerIdx++) { // (note the condition change from < to <=)
        
if(!IsPlayerConnected(x)) continue;//only for connected player
        
format(stringsizeof(string), "[DJ]%s(%d)Has Been Stream The Best Music"IsPlayerName(playerid), playerid);//A Message To Send For All Player
    
SendClientMessage(x0x00FFFFFFstring);//A Function To Send The Message
        
PlayAudioStreamForPlayer(xparams);//Make The Music Are Played!
    
}
    }
return 
1;
}
CMD:stopstream(playeridparams[])
{
    
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!
Reply
#2

use [code] or [php] tags next time.
Код:
CMD:stream(playerid,params[])
turned into
EDIT: thanks you corrected it
Reply
#3

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

MAX_PLAYER loops? shudders
Reply
#5

Quote:
Originally Posted by Jamester
Посмотреть сообщение
MAX_PLAYER loops? shudders
Yes It Is
Reply
#6

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<= HighestPlayerIdx++) { // (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.
Reply
#7

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<= HighestPlayerIdx++) { // (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
Reply
#8

You isn't mention include of zcmd
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)