27.12.2010, 19:44
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;
}