CMD:play(playerid,params[]){
// if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"This command is only for RCON admins!");
if((PlayerInfo[playerid][Level] >= 9)
{
new URL[250];
if(sscanf(params,"s[250]",URL)) return SendClientMessage(playerid,-1,"{39AACC}USAGE: play [URL]");
for(new i=0;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)) continue;
PlayAudioStreamForPlayer(i,URL);
}
SendClientMessage(playerid,COLOR_RED,"You have played a song for all players!");
format(cmdstr, sizeof(cmdstr), "Administrator %s (ID:%d) has started the Global Playback of{FFFFFF} %s", FormatName(playerid), playerid, URL);
SendClientMessageToAll(COLOR_ORANGE, cmdstr);
SendClientMessageToAll(COLOR_YELLOW, "/stop to stop..");
}
else return SendClientMessage(playerid, yellow, "Sorry");
return 1;
}
new URL[250];
`if((PlayerInfo[playerid][Level] >= 9)` count the brackets!
It's a good idea to use a modern IDE such as Sublime, Atom or VS Code which will make it more obvious to you if you have a missing bracket or brace. Check out https://sampforum.blast.hk/showthread.php?tid=531379 |