09.12.2013, 01:14
well, if i do /a ingame you see the message from /a [text] but if you write somting, you dont see it anymore, Example: /a hey how are you
onplayercommandtext
the dcmd
What do i need to add or change to make it work
onplayercommandtext
Quote:
dcmd(a, 1, cmdtext); |
Quote:
dcmd_a(playerid, cmdtext[]) { #pragma unused cmdtext new sendername[MAX_PLAYER_NAME]; new string[256], idx; 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; } |