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

Solved Redirect chat message to yourself


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
finishlast
Senior Member
Join Date: Nov 2018
Location: In Reno with the vitamin
Old 08-22-2020 , 08:55   Redirect chat message to yourself
Reply With Quote #1

Basically this is what I am trying to do.


Check for a specific Steam ID and then redirect everything he/she says to their very own chat window.

i.e. they should just see what they type but everyone else not. So they just talk to themselfs.

I know the !gag command but I want them to keep on chatting and see their own chat messages and surpress it for everyone else.

PHP Code:
public Action OnClientSayCommand(int client, const char[] command, const char[] sArgs)
{
    
decl String:steamID[32];
    
GetClientAuthString(clientsteamID32);
    if(
StrEqual(steamID"STEAM_1:0:blablabla"false)){
    
PrintToChat(client"%N: TEST %s"sArgs);
    return 
Plugin_Stop;
    }
    return 
Plugin_Continue;

When I leave out PrintToChat(client, "%N: TEST %s", sArgs); the output is surpressed for all, including me.

When I put in PrintToChat(client, "%N: TEST %s", sArgs); I see the normal output but not THIS with the TEST in it, I see the normal output again. !?

Any idea what I am doing wrong?
__________________

Last edited by finishlast; 08-23-2020 at 02:24.
finishlast is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 08-22-2020 , 09:32   Re: Redirect chat message to yourself
Reply With Quote #2

You need to pass the client index for %N:

PHP Code:
PrintToChat(client"%N: TEST %s"clientsArgs); 
Also GetClientAuthString has been deprecated, use GetClientAuthId.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.

Last edited by DJ Tsunami; 08-22-2020 at 09:34.
DJ Tsunami is offline
finishlast
Senior Member
Join Date: Nov 2018
Location: In Reno with the vitamin
Old 08-22-2020 , 12:40   Re: Redirect chat message to yourself
Reply With Quote #3

Ah thanks! Sometime you just don't see the simplest things!

Will change to GetClientAuthId thx again.
__________________
finishlast 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:17.


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