Chat Hook, What's Wrong?
Considering the use of valid steam ids. This code doesn't even print a chat message back when someone says something. Any idea what's wrong with it?
Code:
#include <sourcemod> |
Re: Chat Hook, What's Wrong?
http://wiki.alliedmods.net/Format_Cl...mat_Specifiers
You're using %t (which is for translated files.) While I believe you should be using %s. I'm sure if you check the server, each time player_say is fired you'd get an error such as: Code:
L 11/23/2010 - 00:21:22: [SM] Plugin encountered error 4: Invalid parameter or parameter type |
Re: Chat Hook, What's Wrong?
The code after that point doesn't work either... I'll try the %s and get back to you.
Edit: %s isn't working either.. and it doesn't give any error logs. |
Re: Chat Hook, What's Wrong?
Quote:
So, something like: PHP Code:
[edit] Sorry, didn't notice you edited your post. Can you please update your original post with the exact code you're using (with %s) so I can see what may be wrong? Thanks. [/edit] |
Re: Chat Hook, What's Wrong?
The original code has been modified with the %s instead of %t. Any idea what's wrong with it now? It still doesn't print any messages.
|
Re: Chat Hook, What's Wrong?
Are you actually in the server when you test this?
PrintToChatAll is defined as this: PHP Code:
For testing purposes, can you temporarily replace PrintToChatAll with LogMessage? This will let you know if the code is even being reached. [edit] Oh, sorry. I'm going to sleep, and I just realized, you're not checking the client index either. So if client is 0 (using say from server), it will error on GetClientAuthString, since it requires a client index between 1 and MaxClients. Here's a little snippet: PHP Code:
[/edit] |
Re: Chat Hook, What's Wrong?
The more common approach (I am not sure if the game events even actually get called by the game) is to just do RegConsoleCmd("say", Command_PlayerChat); then use that as the callback function.
|
Re: Chat Hook, What's Wrong?
Yes, I've been in the game for all testing.. on a team.. on the blu team... as a scout...
I have also tried LogMessage, it's what I originally started with, and it didn't work either. I also tried LogToFile, and it didn't work either. I also tried the RegConsoleCmd for both say and say_team and they didn't work either. This code that you placed above: Code:
#pragma semicolon 1 |
Re: Chat Hook, What's Wrong?
PHP Code:
|
Re: Chat Hook, What's Wrong?
Quote:
|
All times are GMT -4. The time now is 00:06. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.