Audio Help
#1

Help how to block the url + make that admin command.
i put it on level 5 Still not working. Olny high admin or 5 can use it.
Код:
COMMAND:audio(playerid,params[])
{
    if (APlayerData[playerid][PlayerLevel] >= 5) 
    if(sscanf(params,"s[250]",URL)) return SendClientMessage(playerid,0xFF0000AA,"USAGE:/audio [URL]");
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i)) PlayAudioStreamForPlayer(i,URL);
    }
    SendClientMessage(playerid,0xFF6347FF,"You have played a song for all players!");
    format(cmdstr, sizeof(cmdstr), "Admin %s has started the Global Playback of{FFFFFF} %s",        FormatName(playerid), URL);
    SendClientMessageToAll(0xFF6347FF, cmdstr);
    // Let the server know that this was a valid command
    return 1;
}
Reply
#2

pawn Код:
COMMAND:audio(playerid,params[])
{
    if (APlayerData[playerid][PlayerLevel] >= 5)
{
    if(sscanf(params,"s[250]",URL)) return SendClientMessage(playerid,0xFF0000AA,"USAGE:/audio [URL]");
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i)) PlayAudioStreamForPlayer(i,URL);
    }
    SendClientMessage(playerid,0xFF6347FF,"You have played a song for all players!");
    format(cmdstr, sizeof(cmdstr), "Admin %s has started the Global Playback of{FFFFFF} %s",        FormatName(playerid), URL);
    SendClientMessageToAll(0xFF6347FF, cmdstr);
    // Let the server know that this was a valid command
}
    return 1;
}
Reply
#3

Thanks can you do dis one?

Код:
COMMAND:stopaudio(playerid,params[])
{
    if (APlayerData[playerid][PlayerLevel] >= 5)
	for(new i=0;i<MAX_PLAYERS;i++)
	{
	    if(!IsPlayerConnected(i)) continue;
	 	StopAudioStreamForPlayer(i);
	}
	SendClientMessage(playerid,0xFF6347FF,"You have stopped all audio streaming for players.");
	format(cmdstr, sizeof(cmdstr), "Admin %s has stopped all playing audio streams", FormatName(playerid));
	SendClientMessageToAll(0xFF6347FF, cmdstr);
       // Let the server know that this was a valid command
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)