SA-MP Forums Archive
Command not working - 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: Command not working (/showthread.php?tid=446029)



Command not working - San1 - 24.06.2013

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



Re: Command not working - introzen - 24.06.2013

Quote the error please. Also mark the line where the error is.


Re: Command not working - San1 - 24.06.2013

No errors it just spams the SendClientMessage


Re: Command not working - [ABK]Antonio - 24.06.2013

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

also below


Re: Command not working - park4bmx - 24.06.2013

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


Re: Command not working - San1 - 24.06.2013

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


Re: Command not working - [ABK]Antonio - 24.06.2013

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?


Re: Command not working - San1 - 24.06.2013

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


Re: Command not working - park4bmx - 24.06.2013

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


Re: Command not working - San1 - 24.06.2013

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