Command not working
#1

I gotta use strcmp becuz of the processor.. And It spams the message Song is playing when i havent even typed a URL
Can someone fix this plz

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

Quote the error please. Also mark the line where the error is.
Reply
#3

No errors it just spams the SendClientMessage
Reply
#4

Add
pawn Код:
if(!IsPlayerConnected(i)) continue;
in the loop and see if that fixes it

also below
Reply
#5

for every single loop, you send the message to everyone!
SendClientMessageToAll needs to be SendClientMessage
Reply
#6

Its not letting me type a url still , I HATE STRCMP SOOOO MUCH
Reply
#7

Quote:
Originally Posted by San1
Посмотреть сообщение
Its not letting me type a url still , I HATE STRCMP SOOOO MUCH
Why can't you use YCMD or ZCMD?
Reply
#8

Idk how i can use it with Strcmp i wanna use both but i get Unkown CMD, and i dont wanna Change all cmds to ZCMD
Reply
#9

Quote:
Originally Posted by San1
Посмотреть сообщение
Its not letting me type a url still , I HATE STRCMP SOOOO MUCH
u said u had problems with spamming !!!!!!
if that is the problem then show the isnull function
Reply
#10

Problems-Spams The ClientMessage like Crazy, Wont let me enter a URL at all

pawn Код:
if(strcmp(cmd, "/playall", true) == 4)
    {
        if(PlayerInfo[playerid][pDJ] < 1) return SendClientMessage(playerid, COLOR_WHITE, "DJ Only Command");
        if(!cmdtext[4]) return SendClientMessage(playerid, -1, "USAGE: /playforall [url]");
        for(new i = 0; i < MAX_PLAYERS; i ++)
        {
            PlayAudioStreamForPlayer(i, cmdtext[4]);
            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


Forum Jump:


Users browsing this thread: 1 Guest(s)