AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Help] reading server prints (https://forums.alliedmods.net/showthread.php?t=325016)

Thew_ConFiger 06-05-2020 04:19

[Help] reading server prints
 
Hello
Is there Anyway to read server prints like client_print() or somethings like that

Or even hudmessages?
Example for what i want :
Welcome to server!

When server print this message, plugin must use a command in server like sv_alltalk 1

supertrio17 06-05-2020 05:55

Re: [Help] reading server prints
 
I belive you can use read_data(), but I didn't use it that much, so I don't know how. But it detects server events :)

Thew_ConFiger 06-05-2020 06:26

Re: [Help] reading server prints
 
Ok , but how can i detect that server prints ?
To read_data

I can do it for clients by register_clcmd "say"

But what about server?

supertrio17 06-05-2020 06:43

Re: [Help] reading server prints
 
Did you try register_concmd? It's server console, and regular console in one, you can put command that you want to be printed.

Example:

PHP Code:

public plugin_init() 
{
    
register_concmd("amx_cvar""cvar_print")



supertrio17 06-05-2020 06:48

Re: [Help] reading server prints
 
I just found this thing
Code:

native console_print(id, const message[], any:...);
here

Natsheh 06-05-2020 06:53

Re: [Help] reading server prints
 
You can't hook client_print unless you're using orpheu or okapi but you can catch messages that are sent with emessage function

fysiks 06-05-2020 21:17

Re: [Help] reading server prints
 
Quote:

Originally Posted by supertrio17 (Post 2704083)
I belive you can use read_data(), but I didn't use it that much, so I don't know how. But it detects server events :)

I think you're getting a little carried away with trying to help. You need a lot more experience to be answer these type of questions. So, at the very least, you should test your suggestions before you post them.

Natsheh 06-06-2020 03:09

Re: [Help] reading server prints
 
And for the topic author I really suggest first to search before making a new thread when it has already been answered.

Bugsy 06-06-2020 11:30

Re: [Help] reading server prints
 
Thew_ConFiger, can you explain specifically why you need the console message as a trigger? In your example you only state that you want to set a cvar based on the welcome message. You may be over-complicating this. You can hook things, like Con_Printf() using orpheu, but again, explain further what you're trying to do.

mahbodsr 06-07-2020 15:34

Re: [Help] reading server prints
 
Quote:

Originally Posted by Bugsy (Post 2704304)
Thew_ConFiger, can you explain specifically why you need the console message as a trigger? In your example you only state that you want to set a cvar based on the welcome message. You may be over-complicating this. You can hook things, like Con_Printf() using orpheu, but again, explain further what you're trying to do.

he wants hook some server messages , to do smthng when it prints ( like color chat or client print )
thats all.


All times are GMT -4. The time now is 17:12.

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