Whats wrong
#1

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;
    }
Reply
#2

Hi !

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

Vince++
Reply
#3

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

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;
    }
Reply
#5

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;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)