AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved ... (https://forums.alliedmods.net/showthread.php?t=329975)

Theodore Bagwell 01-15-2021 04:02

...
 
...

fysiks 01-16-2021 03:09

Re: Read data
 
It would make more sense to trigger off of some other event.

Bugsy 01-16-2021 09:40

Re: Read data
 
Agree with fysiks. Explain what you're ultimately trying to do, there may be a much simpler way instead of scanning every single server message.

Theodore Bagwell 01-16-2021 12:19

Re: Read data
 
Quote:

Originally Posted by Bugsy (Post 2732815)
Agree with fysiks. Explain what you're ultimately trying to do, there may be a much simpler way instead of scanning every single server message.

Unfortunately I did not understand what fysiks says.
I just want to know if such a thing is possible at all?

Theodore Bagwell 01-16-2021 12:23

Re: Read data
 
....

hitD 01-16-2021 14:04

Re: Read data
 
For client print there exist fakemeta forward, just register this FM_ClientPrintf(haven't tried but it should work fine).
For color chat i guess it use SayText event so you need to register it. How to register if u don't know for client_print function
HTML Code:

public plugin_init()
{
  register_forward(FM_ClientPrintf, "yourfunction")
}
public yourfunction(id, chat_type, message[])
{
/// Do whatever you want
}

for custom say or w/e
HTML Code:

public plugin_init()
{
  register_message(get_user_msgid("SayText"), "yourfunction")
}
public yourfunction(msg_id, msg_dest, receiver)
{
/// Do whatever you want but if u want to read it just do get_msg_arg_{type}(param, ....)
///for arguments
///1 is Sender id
///2 is the message
}

I hope that's what you want.

Bugsy 01-16-2021 16:30

Re: Read data
 
Tell us specifically what you are trying to do and we may be able to recommend a better and more efficient way to do it.

I understand you want to read console messages, but that does not answer my question.

Theodore Bagwell 01-19-2021 11:41

Re: Read data
 
....

redivcram 01-19-2021 12:54

Re: Read data
 
Stop glossing over questions and answer them. You still don't make sense as to what you want to achieve. We can't just throw around random code and get a "didn't work". It doesn't work because you didn't properly ask for what you want. This is where the "better and more efficient way" comes in when you properly ask a question, or in translation "way that works".

CrazY. 01-19-2021 13:07

Re: Read data
 
If the message is sent by the server or one of the amxmodx natives (client_print, engclient_print, etc), you could use orpheu. if it's sent by some plugin using message_begin and SayText, you will need to edit the plugin (search for emessage_begin) so you are able to hook the message as hitD showed you in his second code. Orpheu could also be used in that case, but you would hook the message_begin native instead.

It would be easier to simply edit the plugin that sends the message or do what fysiks suggested to be honest, I'm not sure why you are not considering that option.


All times are GMT -4. The time now is 14:11.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.