HELP[REP+]
#1

PHP код:
cmd(streamplayeridparams[])
{
    if(
Account[playerid][Dj] == 1)
    {
        new 
string[MAX_PLAYERS], url[MAX_PLAYERS];
        if(
sscanf(params"s[500]"url)) return SendClientMessage(playerid, -1"Usage: /stream [URL]");
        if(
Account[playerid][Streaming] == 1) return SendClientMessage(playerid, -1"{FF9900}Error: You must turn on your streaming mode!");
        for(new 
0MAX_PLAYERSi++)
        {
        if(
Account[i][Streaming] == 1)
    
SendClientMessage(i, -1"=========================================");
        
StopAudioStreamForPlayer(i);
        
PlayAudioStreamForPlayer(iurl);
        
SendClientMessage(i, -1"=========================================");
        }
        return 
1;
    }
    else return 
0;
}
cmd(nostreamplayeridparams[])
{
    if(
Account[playerid][Streaming] == 1)
    {
        
Account[playerid][Streaming] = 0;
        
SendClientMessage(playerid, -1"{FF6600}» You have been turn off streaming mode.");
        
StopAudioStreamForPlayer(playerid);
    } else {
        
Account[playerid][Streaming] = 1;
        
SendClientMessage(playerid, -1"{FFFF00}» You have been turn on streaming mode.");
    }
    return 
1;

I Try To Make Only The Player That Turned His Streaming Mode On Can Hear This Song Can You Guys Help Me??
Reply
#2

You miss a { after this, if(Account[i][Streaming] == 1)
Reply
#3

PHP код:
cmd(streamplayeridparams[])
{
    if(
Account[playerid][Dj] == 1)
    {
        new 
string[MAX_PLAYERS], url[MAX_PLAYERS];
        if(
sscanf(params"s[500]"url)) return SendClientMessage(playerid, -1"Usage: /stream [URL]");
        if(
Account[playerid][Streaming] == 0) return SendClientMessage(playerid, -1"{FF9900}Error: You must turn on your streaming mode!");
        for(new 
0MAX_PLAYERSi++)
        {
        if(
Account[i][Streaming] == 1) {
    
SendClientMessage(i, -1"=========================================");
        
StopAudioStreamForPlayer(i);
        
PlayAudioStreamForPlayer(iurl);
        
SendClientMessage(i, -1"=========================================");
        }
        return 
1;
    }
    else return 
0;
}
cmd(nostreamplayeridparams[])
{
    if(
Account[playerid][Streaming] == 1)
    {
        
Account[playerid][Streaming] = 0;
        
SendClientMessage(playerid, -1"{FF6600}» You have been turn off streaming mode.");
        
StopAudioStreamForPlayer(playerid);
    } else {
        
Account[playerid][Streaming] = 1;
        
SendClientMessage(playerid, -1"{FFFF00}» You have been turn on streaming mode.");
    }
    return 
1;

Код:
if(Account[playerid][Streaming] == 1) return SendClientMessage(playerid, -1, "{FF9900}Error: You must turn on your streaming mode!");
should be:
PHP код:
if(Account[playerid][Streaming] == 0) return SendClientMessage(playerid, -1"{FF9900}Error: You must turn on your streaming mode!"); 
and you miss { after
PHP код:
if(Account[i][Streaming] == 1
Reply
#4

Quote:
Originally Posted by jlalt
Посмотреть сообщение
PHP код:
cmd(streamplayeridparams[])
{
    if(
Account[playerid][Dj] == 1)
    {
        new 
string[MAX_PLAYERS], url[MAX_PLAYERS];
        if(
sscanf(params"s[500]"url)) return SendClientMessage(playerid, -1"Usage: /stream [URL]");
        if(
Account[playerid][Streaming] == 0) return SendClientMessage(playerid, -1"{FF9900}Error: You must turn on your streaming mode!");
        for(new 
0MAX_PLAYERSi++)
        {
        if(
Account[i][Streaming] == 1) {
    
SendClientMessage(i, -1"=========================================");
        
StopAudioStreamForPlayer(i);
        
PlayAudioStreamForPlayer(iurl);
        
SendClientMessage(i, -1"=========================================");
        }
        return 
1;
    }
    else return 
0;
}
cmd(nostreamplayeridparams[])
{
    if(
Account[playerid][Streaming] == 1)
    {
        
Account[playerid][Streaming] = 0;
        
SendClientMessage(playerid, -1"{FF6600}» You have been turn off streaming mode.");
        
StopAudioStreamForPlayer(playerid);
    } else {
        
Account[playerid][Streaming] = 1;
        
SendClientMessage(playerid, -1"{FFFF00}» You have been turn on streaming mode.");
    }
    return 
1;

Код:
if(Account[playerid][Streaming] == 1) return SendClientMessage(playerid, -1, "{FF9900}Error: You must turn on your streaming mode!");
should be:
PHP код:
if(Account[playerid][Streaming] == 0) return SendClientMessage(playerid, -1"{FF9900}Error: You must turn on your streaming mode!"); 
and you miss { after
PHP код:
if(Account[i][Streaming] == 1
already Put But When i use /stream http://myurl Then It Be Nothing
Reply
#5

Anyone Please??
Reply
#6

The url has to end with .mp3.
Reply
#7

Quote:
Originally Posted by jihadmeneer
Посмотреть сообщение
The url has to end with .mp3.
ya i know dude already try it you also can try compile and debug this script when you put url it will be not stream and it be nothing
Reply
#8

give me a second i will help you..
Have you see the page of the function, i think that you have forgot some parameter:
URL
Reply
#9

Код:
cmd(stream, playerid, params[])
{
    if(Account[playerid][Dj] == 1)
    {
        new url[60];
        if(sscanf(params, "s[60]", url)) return SendClientMessage(playerid, -1, "Usage: /stream [URL]");
        if(Account[playerid][Streaming] == 0) return SendClientMessage(playerid, -1, "{FF9900}Error: You must turn on your streaming mode!");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
        	if(Account[i][Streaming] == 1)
        	{
   			SendClientMessageToAll(-1, "=========================================");
       			StopAudioStreamForPlayer(i);
        		PlayAudioStreamForPlayer(i, url);
        		SendClientMessageToAll(-1, "=========================================");
        	}
        }
        return 1;
    }
    else return 0;
}
Should work.

The fix: You had a useless variable string which had it's length as MAX_PLAYERS? also your url variable was [MAX_PLAYERS] and in sscanf params it was [500]? Changed these.

Test the audio with this URL: http://somafm.com/tags.pls
Reply
#10

Quote:
Originally Posted by Affan
Посмотреть сообщение
Код:
cmd(stream, playerid, params[])
{
    if(Account[playerid][Dj] == 1)
    {
        new url[60];
        if(sscanf(params, "s[60]", url)) return SendClientMessage(playerid, -1, "Usage: /stream [URL]");
        if(Account[playerid][Streaming] == 0) return SendClientMessage(playerid, -1, "{FF9900}Error: You must turn on your streaming mode!");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
        	if(Account[i][Streaming] == 1)
        	{
   			SendClientMessageToAll(-1, "=========================================");
       			StopAudioStreamForPlayer(i);
        		PlayAudioStreamForPlayer(i, url);
        		SendClientMessageToAll(-1, "=========================================");
        	}
        }
        return 1;
    }
    else return 0;
}
Should work.

The fix: You had a useless variable string which had it's length as MAX_PLAYERS? also your url variable was [MAX_PLAYERS] and in sscanf params it was [500]? Changed these.

Test the audio with this URL: http://somafm.com/tags.pls
Thx Letme try
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)