SA-MP Forums Archive
Why isnt this 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: Why isnt this working? (/showthread.php?tid=316404)



Why isnt this working? - geerdinho8 - 06.02.2012

pawn Код:
if(strcmp(cmd, "/announce", true) == 0)
    {
        if(pInfo[playerid][Admin] > 0)
        {
            tmp = strtok(cmdtext,idx), tmp2 = strtok(cmdtext,idx);
            new Announce;
            Announce = strval(tmp);
            if(!strlen(tmp))

         {
             SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /announce [message]");
         }
                        else
         {


        format( string, sizeof(string), "%s", Announce );
        GameTextForAll(string, 5000, 4 );
                        }
                }
                return 1;
}



Re: Why isnt this working? - geerdinho8 - 06.02.2012

bump


Re: Why isnt this working? - Cameltoe - 06.02.2012

pawn Код:
command(announce, playerid, params[])
{
    new string[128];
    if(pInfo[playerid][Admin] > 0)
    {
        if(sscanf(params,  "s[128]", string)) return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /announce [message]");
        else
        {
            GameTextForAll(string, 5000, 4);
        }
    }
    return 1;
}



Re: Why isnt this working? - Rac3r - 06.02.2012

Код:
new Announce;
Announce = strval(tmp);
Quote:
Originally Posted by Y-Less
It works perfectly.



Re: Why isnt this working? - geerdinho8 - 06.02.2012

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
pawn Код:
command(announce, playerid, params[])
{
    new string[128];
    if(pInfo[playerid][Admin] > 0)
    {
        if(sscanf(params,  "s[128]", string)) return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /announce [message]");
        else
        {
            GameTextForAll(string, 5000, 4);
        }
    }
    return 1;
}
I ask for a solution, not for a total new script, but anyways thanks.]
Someone has a solution?


Re: Why isnt this working? - Cameltoe - 07.02.2012

Quote:
Originally Posted by ******
Посмотреть сообщение
Yes, you just ignored it:
That plus:

Quote:
Originally Posted by geerdinho8
Посмотреть сообщение
I ask for a solution, not for a total new script, but anyways thanks.]
Someone has a solution?
I didn't write a new script i made it more efficient.