06.03.2012, 00:34
pawn Код:
if(strcmp(cmd, "msg", true) == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
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, COLOR_GRAD2, "USAGE: /msg [texto]");
format(string, sizeof(string), "* Admin: %s",result);
SendClientMessageToAll(COLOR_GREEN, string);
return 1;
}
}