Code
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd,"/overlord",true)==0)
{
if(IsPlayerConnected(playerid))
{
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))
{
SendClientMessage(playerid, COLOR_WHITE, "Используйте: /Overlord [текст]");
return 1;
}
new string[256];
format(string, sizeof(string), "Overlord: %s ", result);
SendClientMessageToAll(COLOR_WHITE, string);
}
return 1;
}