SA-MP Forums Archive
Help me with cmd please - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help me with cmd please (/showthread.php?tid=478259)



Help me with cmd please - PrinceOfPersia - 28.11.2013

Hello guys
Can any one help me and make for me a cmd

CMD for how to play a music for the all players not just me

Just for admins

I'm using ZCMD

Script is scripted by strcmp


Re: Help me with cmd please - ikbenremco - 29.11.2013

Usage: /streamtoall link SONGNAME SONGARTIST.

PHP код:
CMD:streamtoall(playeridparams[])
{
    new 
song[128], songname[128], songartist[128];
    new 
string[128];
    if(
sscanf(params"sss"songsongnamesongartist)) return SendClientMessage(playeridCOLOR_GRAD1"USAGE: /streamtoall [Web link to an audio file. (mp3skull.com)] [Song Name (Underscore for space)] [Song Artist (Underscore for space)]");
    for(new 
0strlen(songname); i++)
    {
        if(
songname[i] == '_')
        {
            
songname[i] = ' ';
        }
    }
    for(new 
0strlen(songartist); i++)
    {
        if(
songartist[i] == '_')
        {
            
songartist[i] = ' ';
        }
    }
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
                
format(stringsizeof(string), "Song playing: %s by %s."songnamesongartist);
                
SendClientMessage(iCOLOR_ORANGEstring);
                
PlayAudioStreamForPlayer(isong);
        }
    }
    return 
1;

To stop the music:

PHP код:
CMD:stopplay(playeridparams[])
{
    
StopAudioStreamForPlayer(playerid);
    
SendClientMessage(playeridCOLOR_ORANGE"Audio stopped!");
    return 
1;