Raised This Month: $32 Target: $400
 8% 

[Help] reading server prints


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Thew_ConFiger
Member
Join Date: Apr 2019
Old 06-05-2020 , 04:19   [Help] reading server prints
Reply With Quote #1

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

Last edited by Thew_ConFiger; 06-05-2020 at 06:23.
Thew_ConFiger is offline
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-05-2020 , 05:55   Re: [Help] reading server prints
Reply With Quote #2

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
supertrio17 is offline
Thew_ConFiger
Member
Join Date: Apr 2019
Old 06-05-2020 , 06:26   Re: [Help] reading server prints
Reply With Quote #3

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?
Thew_ConFiger is offline
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-05-2020 , 06:43   Re: [Help] reading server prints
Reply With Quote #4

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 is offline
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-05-2020 , 06:48   Re: [Help] reading server prints
Reply With Quote #5

I just found this thing
Code:
native console_print(id, const message[], any:...);
here
supertrio17 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-05-2020 , 06:53   Re: [Help] reading server prints
Reply With Quote #6

You can't hook client_print unless you're using orpheu or okapi but you can catch messages that are sent with emessage function
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-05-2020 , 21:17   Re: [Help] reading server prints
Reply With Quote #7

Quote:
Originally Posted by supertrio17 View Post
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.
__________________
fysiks is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-06-2020 , 03:09   Re: [Help] reading server prints
Reply With Quote #8

And for the topic author I really suggest first to search before making a new thread when it has already been answered.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-06-2020 , 11:30   Re: [Help] reading server prints
Reply With Quote #9

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.
__________________
Bugsy is offline
mahbodsr
Member
Join Date: Jun 2016
Old 06-07-2020 , 15:34   Re: [Help] reading server prints
Reply With Quote #10

Quote:
Originally Posted by Bugsy View Post
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.
mahbodsr is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:33.


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