Thread: Minor problem
View Single Post
Old 17/03/2010, 06:06 PM   #4
PowerSurge
Little Clucker
 
Join Date: Feb 2009
Posts: 36
Reputation: 0
Default Re: Minor problem

pawn Code:
dcmd_ooc(playerid, params[])
    {
    new sendername[32];
    new idx;
    new string[128];

    GetPlayerName(playerid, sendername, sizeof(sendername));
    new length = strlen(params);
    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_GRAD2, "USAGE: (/o)oc [ooc chat]");
    return 1;
    }
    format(string, sizeof(string), "OOC [%d]%s: %s", playerid, sendername, result);
    SendClientMessageToAll(COLOR_WHITE,string);
    printf("%s", string);
    return 1;
    }
PowerSurge is offline