26.07.2013, 02:56
I think is this you want...
i don't test if this code :S
this uses SSCANF by ******
i don't test if this code :S
pawn Код:
stock PlayStreamForAll(link[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
StopAudioStreamForPlayer(i);
PlayAudioStreamForPlayer(i, link);
}
print("[AdmCmd]: Admin Is Streaming Music Globally.");
return 1;
}
if(strcmp(cmd, "/stream", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
new link[128];
if(sscanf(cmdtext, "s[128]", cmd, link))
{
SendClientMessage(playerid, COLOR_GREY,"USAGE: /stream <link>");
return 1;
}
PlayStreamForAll(link);
}
else
{
SendClientMessage(playerid, COLOR_GREY," You are not authorized to use that command !");
}
return 1;
}
if(strcmp(cmd, "/stopstream", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
StopAudioStreamForPlayer(i);
}
}
return 1;
}