03.04.2013, 15:03
I need that when I will write a /me command , so if the command is too long the text will be in 2 lines.
Thanks for the helpers
This is my /me Command!
Thanks for the helpers
This is my /me Command!
PHP код:
if(strcmp(cmd, "/me", true) == 0)
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' ')) {
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) {
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result)) {
SendClientMessage(playerid, 0xFFFFFFFF, " /me [action]");
return 1;
}
format(string, sizeof(string), "* %s %s", GetName(playerid), result);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}