More Efficient way of Global Chat?
#3

I couldn't figure one out, so I took this from Raven's and (tried) to mod it for zcmd

pawn Code:
CMD:o(playerid, params[])
{
    new tmp[30], idx,length = strlen(params), Name[24], string[160];
    tmp = strtok(params, idx);
    GetPlayerName(playerid, Name, sizeof(Name));
    while ((idx < length) && (params[idx] <= ' '))
    {
        idx++;
    }
    new offset = idx;
    new result[128];
    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
    {
        result[idx - offset] = params[idx];
        idx++;
    }
    result[idx - offset] = EOS;
    if(!strlen(result))
    {
        SendClientMessage(playerid, COLOR_RED, "[Server] Usage: /o [OOC chat]");
        return 1;
    }
    format(string, sizeof(string),"(( %s[%i]: %s ))", Name, playerid, result);
    SendClientMessageToAll(COLOR_NEUTRALBLUE, string);
    return 1;
}
Reply


Messages In This Thread
More Efficient way of Global Chat? - by randomkid88 - 27.12.2010, 19:22
Re: More Efficient way of Global Chat? - by MadeMan - 27.12.2010, 19:28
Re: More Efficient way of Global Chat? - by randomkid88 - 27.12.2010, 19:44
Re: More Efficient way of Global Chat? - by MadeMan - 27.12.2010, 19:48
Re: More Efficient way of Global Chat? - by randomkid88 - 27.12.2010, 19:54
Re: More Efficient way of Global Chat? - by MadeMan - 27.12.2010, 20:00

Forum Jump:


Users browsing this thread: 1 Guest(s)