Raised This Month: $12 Target: $400
 3% 

Chat Revamp API V1.2b


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Plugin Info:     Modification:   Counter-Strike        Category:   Technical/Development       
eyal282
Veteran Member
Join Date: Aug 2011
Old 07-16-2017 , 19:52   Chat Revamp API V1.2b
Reply With Quote #1

I did not perfectly test it but there isn't a reason it won't work. My current suspicion is that SayText may be sent more than once per chat.

This plugin revamps the chat ( say/_team ) and allows with a single forward and a single native, allowing to stop a player from receiving chat from a specific player and even eavesdrop to team chat.

Despite being API, there are built in features.

API Forward:

Code:
public client_ChatPrintByPlayer(sender, receiver, bool:WillSend, bool:TeamChat, Message[], MessageTags[])

sender = player sending the chat message.

receiver = player receiving the chat message.

bool:WillSend = true if the message will be sent at all ( might be altered if return 2 is applied, causing eavesdropping of team chat only ).

bool:TeamChat = true if the chat is team chat.

Message[] = The message the sender wrote that the receiver is going to receive.

MessageTags[] = The tags accompanied with the message. Completely useless if you don't wish to block the message with return 1 and use the native to resend the message with censorship for example.

return 0 to ignore, return 1 to block the receiver from receiving the chat, return 2 to receive the chat even if it's team chat.
API Native:

Code:
native print_special_colorchat(index, sender, Message[], MessageTags[]);

index = index receiving the message.
sender = player sending the message. Used to display his name and team color.
Message[] = Message to send. Only this should be altered in general.
MessageTags[] = The tags accompanied with the message.
Current functions outside of API:

Code:
say /blockchat <target> - blocks / unblocks target from chatting to you. Doesn't affect ADMIN_IMMUNITY. You can't send chat messages to blocked targets in addition to receiving them.

say /stopchat - blocks / unblocks all chat messages. Doesn't affect chat sent by ADMIN_IMMUNITY.

Dead to alive chat modified by cvar.

Team chat disable by cvar. In disable of team chat, all team chats are sent as normal chats.

Allow blocking players from chatting by cvar.

Allow blocking the general chat by cvar.
CVARs:

Note: All cvars are set in the beginning of the map.

Code:
chat_revamp_enabled - Enables entire plugin. Default 1.
chat_allow_dead_to_alive - Allows dead player to chat alive players if set to 1. Default 0.
chat_allow_team_chat - Allows player to chat to their team if set to 1. Default 1.
chat_allow_block - Allows player to block chat from specific players if set to 1. Doesn't apply on sending ADMIN_IMMUNITY. Default 1.
chat_allow_stop_chat - Allows player to disable receiving chat. Doesn't apply on sending ADMIN_IMMUNITY. Default 1.
Sorry for giving a plugin that might not even work but it'll take a day for people to evaluate whether or not it's working ( I generally need a server with 2 real players to test it properly ).
Attached Files
File Type: sma Get Plugin or Get Source (ChatRevamp.sma - 778 views - 7.8 KB)

Last edited by eyal282; 07-19-2017 at 14:04.
eyal282 is offline
 


Thread Tools
Display Modes

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 19:32.


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