Help for announce command
#4

Try this:
pawn Код:
if(strcmp(cmdtext, "/announce", true))
{
    new
        string[ 128 ],
        idx
    ;
    if(!IsPlayerAdmin(playerid)) return 0;
    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)) return SendClientMessage(playerid, -1, "USAGE: /announce [text]");
    format(string, sizeof(string), "%s", result);
    GameTextForAll(string, 5000, 3);
    return 1;
}
Edit: i suggest you to use zcmd
Created With ZCMD:
pawn Код:
COMMAND:announce(playerid,params[])
{
    if(isnull(params)) return SendClientMessage(playerid, -1, "USAGE: /announce [Text]");
    GameTextForAll(params,5000,3);
    return 1;
}
Reply


Messages In This Thread
Help for announce command - by mitchboy - 14.04.2011, 13:57
Re: Help for announce command - by Seven_of_Nine - 14.04.2011, 14:06
Re: Help for announce command - by Sascha - 14.04.2011, 14:59
Re: Help for announce command - by HyperZ - 14.04.2011, 15:14

Forum Jump:


Users browsing this thread: 1 Guest(s)