08.12.2013, 01:31
Well, i have a admin chat and this is only for Rcon admins, but how can i create it for Admins without rcon
Quote:
dcmd_a(playerid, cmdtext[]) { #pragma unused cmdtext new sendername[MAX_PLAYER_NAME]; new string[256], idx; if (!IsPlayerAdmin(playerid)) SendClientMessage(playerid, COLOR_BLUE, "You're not an admin."); else { 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, COLOR_WHITE, "USAGE: /a <message>"); return 1; } format(string, sizeof(string), "[AdminChat]%s: %s", sendername, result); SendAdminMessage(COLOR_WHITE,string); return 1; } return 1; } |