Post the full code. There's no reason for it not to work from what you told us. Check if you spelled client_putinserver() correctly.
PS: don't hardcode buffer lengths. Use charsmax(message) instead of 511.
PS2: no reason to use formatex() and a variable since console_print() supports direct string formatting.