SA-MP Forums Archive
Whats wrong - 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: Whats wrong (/showthread.php?tid=446034)



Whats wrong - San1 - 24.06.2013

When i type /playall without entering anything with a space.. it shows Unknown Command.. but when i type it with a space.. Example: /playall redsasd, it dont show anything at all but it suppose to show playing a stream.. someone tell me how or show me how to fix

pawn Код:
if (!strcmp(cmdtext, "/playall", true, 11))
    {
        if(PlayerInfo[playerid][pDJ] < 1) return SendClientMessage(playerid, COLOR_WHITE, "DJ Only Command");
        if(!cmdtext[11]) return SendClientMessage(playerid, -1, "USAGE: /playall [url]");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            PlayAudioStreamForPlayer(i, cmdtext[12]);
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "You can stop playing this song with /stopall");
            SendClientMessage(i, COLOR_LIGHTBLUE, "An DJ has started playing a song (use /stopaudio to stop this song for you");
        }
        return 1;
    }



Re: Whats wrong - vardanega - 24.06.2013

Hi !

cmdtext[12] return "/playall +URL" make a printf for view type of return.

Vince++


Re: Whats wrong - San1 - 24.06.2013

You got it all wrong its nothing having to do with that


Re: Whats wrong - dEcooR - 24.06.2013

try this

Код:
if(!strcmp(cmdtext, "/playall", true))
    {
         new url[32];
         if(PlayerInfo[playerid][pDJ] != 1) return SendClientMessage(playerid, COLOR_WHITE, "DJ Only Command");
         else if(!strlen(url) || strlen(url) > 32) return SendClientMessage(playerid, -1, "USAGE: /playall [url]");
         else
        {
              for(new i = 0; i < MAX_PLAYERS; i++) 
              {
                  PlayAudioStreamForPlayer(i, url);
                  SendClientMessage(playerid, COLOR_LIGHTBLUE, "You can stop playing this song with /stopall");
                  SendClientMessage(i, COLOR_LIGHTBLUE, "An DJ has started playing a song (use /stopaudio to stop this  song for you");
               }
         }
        return 1;
    }



Re: Whats wrong - introzen - 24.06.2013

pawn Код:
if(strcmp("/playall", cmdtext, true, 8) == 0)
    {
        if(!cmdtext[8]) return SendClientMessage(playerid, -1, "USAGE: /playforall [url]");
        for(new i = 0; i < MAX_PLAYERS; i ++)
        {
            if(!IsPlayerConnected(i)) continue;
            PlayAudioStreamForPlayer(i, cmdtext[9]);
            SendClientMessage(playerid, 0x0000FFAA, "You can stop playing this song with /stopall");
            SendClientMessage(i, 0x0000FFAA, "An DJ has started playing a song (use /stopaudio to stop this song for you)");
        }
        return 1;
    }