cmd(stream, playerid, params[])
{
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 i = 0; i < MAX_PLAYERS; i++)
{
if(Account[i][Streaming] == 1)
SendClientMessage(i, -1, "=========================================");
StopAudioStreamForPlayer(i);
PlayAudioStreamForPlayer(i, url);
SendClientMessage(i, -1, "=========================================");
}
return 1;
}
else return 0;
}
cmd(nostream, playerid, params[])
{
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;
}
cmd(stream, playerid, params[])
{
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 i = 0; i < MAX_PLAYERS; i++)
{
if(Account[i][Streaming] == 1) {
SendClientMessage(i, -1, "=========================================");
StopAudioStreamForPlayer(i);
PlayAudioStreamForPlayer(i, url);
SendClientMessage(i, -1, "=========================================");
}
return 1;
}
else return 0;
}
cmd(nostream, playerid, params[])
{
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!");
if(Account[playerid][Streaming] == 0) return SendClientMessage(playerid, -1, "{FF9900}Error: You must turn on your streaming mode!");
if(Account[i][Streaming] == 1)
PHP код:
Код:
if(Account[playerid][Streaming] == 1) return SendClientMessage(playerid, -1, "{FF9900}Error: You must turn on your streaming mode!"); PHP код:
PHP код:
|
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; }
Код:
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; } 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 |