Вставляем в public OnPlayerCommandText.
Код:
else if(strcmp(cmd, "/msg", true) == 0 || strcmp(cmd, "/message", true) == 0) { if (PlayerInfo[playerid][pAdmin] >= 4) { if(IsPlayerConnected(playerid)) { new sendername[MAX_PLAYER_NAME]; new string[124]; 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)) { SendClientMessage(playerid, -1, "Используйте: /msg [text]"); return 1; } format(string, sizeof(string), "{FFCD00}Администратор %s: %s", sendername, result); SendClientMessageToAll(0xFFCD00AA, string); } return 1; } }