SA-MP Forums Archive
help in /announce || /ann - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: help in /announce || /ann (/showthread.php?tid=227896)



help in /announce || /ann - MBX97 - 18.02.2011

please help me guyz in this cmd,
when i use it as : /ann [NoText] and /announce [NoText] it sayd the usage
but when i use it /announce [Text] it says SERVER:Unknown Command
why , here the /announce or /ann cmd
check it and fix it plz
CLICK ME =)


Re: help in /announce || /ann - HyperZ - 18.02.2011

pawn Код:
if (!strcmp("/ann", cmdtext, true) || !strcmp("/announce", cmdtext, true))
{
    if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xff0000ff, "Need To Be A RCON Admin !");
    new length = strlen(cmdtext);
    while ((idx < length) && (cmdtext[idx] <= ' '))
    {
        idx++;
    }
    new offset = idx;
    new result[64];
    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
    {
        result[idx - offset] = cmdtext[idx];
        idx++;
    }
    result[idx - offset] = EOS;
    if(!strlen(result))
    {
        SendClientMessage(playerid, -1, "USAGE: /ann [text]");
        return 1;
    }
    GameTextForAll(result, 5000, 0);
    return 1;
}
Edit: not tested.


Re: help in /announce || /ann - jejemonerz123 - 18.02.2011

maybe you forgot to set your level XD


Re: help in /announce || /ann - MBX97 - 18.02.2011

i didn't xD and btw its not working


Re: help in /announce || /ann - admantis - 19.02.2011

I need to know your using strcmp strtok zcmd y_ini sscanf2 or what?