20.03.2009, 18:27
pawn Код:
if(strcmp(cmd, "/announce", true) == 0)
{
new length = strlen(cmdtext);
new idx;
new string[128];
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, COLOR_GRAD2, "USAGE: /announce [TEXT]");
return 1;
}
format(string,sizeof(string), "| Announcement: | %s", result);
SendClientMessageToAll(COLOR_YELLOW,tString);
return 1;
}