AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [Any] FakeSay (https://forums.alliedmods.net/showthread.php?t=164876)

Mitch 08-16-2011 15:06

[Any] FakeSay
 
2 Attachment(s)
Description:
A "Safe" version of sm_fakesay that doesn't let you force the client to use commands.

Cvars:

sm_fakesay_version - shows the plugin version.

Commands:
sm_fakesay <#userid|name> <text> - the fakesay command.

Notes:
Needs http://forums.alliedmods.net/showthread.php?t=96831
to compile.

Antithasys 08-16-2011 18:53

Re: [Any] FakeSay
 
Lolz. Better code:

PHP Code:

public Action:Command_Fakesay(clientargs)
{
    
ReplyToCommand(client"Speak for yourself!");
    return 
Plugin_Handled;


Fun in any case!

DarthNinja 11-21-2011 17:33

Re: [Any] FakeSay
 
Two quick fixes required:
  • You don't need to include <admin> since you aren't using any admin[menu] functions.
  • Please update this to use ProcessTargetString unless you have some specific reason to prevent admins from using group targeting.

    Also, you might want to add support for fake team chat messages.

Dr. McKay 11-23-2011 01:41

Re: [Any] FakeSay
 
The sm_fakesay in FuncommandsX was already updated to essentially this code.

Directly from the FuncommandsX source code:

PHP Code:

public Action:Command_Fakesay(client,args)
{
    if(
args  != 2)
    {
        
ReplyToCommand(client"[SM] Usage: sm_fakesay <#userid|name> <text>");
        return 
Plugin_Handled;
    }

    
decl String:Target[64];
    
decl String:text[128];

    
GetCmdArg(1Targetsizeof(Target));
    
GetCmdArg(2textsizeof(text));

    new 
itarget FindTarget(clientTarget);
    if(
itarget == -1)
    {
        
ReplyToCommand(client"Unable to find target");
        return 
Plugin_Handled;
    }
    
CPrintToChatAllEx(itarget"{teamcolor}%N{default} :  %s"itargettext);
    
LogAction(clientitarget"%L made %L say %s "clientitargettext);
    
    return 
Plugin_Handled;


Matter of fact, if you extract Command_Fakesay from this plugin and from fakesay.sp in the FuncommandsX package and remove the whitespace, they're identical.

DarthNinja 11-23-2011 03:40

Re: [Any] FakeSay
 
McKay:
http://forums.alliedmods.net/showpos...&postcount=383

Dr. McKay 11-23-2011 11:58

Re: [Any] FakeSay
 
Quote:

Originally Posted by DarthNinja (Post 1601163)

Cool. And I was wondering if this was our Mitch.

Sidder 01-14-2012 07:29

Re: [Any] FakeSay
 
Could be mentiond what flag is needed?


edit; thx for the idea, was able to sort it like that :)

DarthNinja 01-14-2012 16:00

Re: [Any] FakeSay
 
It's ADMFLAG_BAN or whatever you set.

nynCuKaH 05-22-2014 15:28

Re: [Any] FakeSay
 
Quote:

Originally Posted by Dr. McKay (Post 1601128)
The sm_fakesay in FuncommandsX was already updated to essentially this code.

Directly from the FuncommandsX source code:

PHP Code:

public Action:Command_Fakesay(client,args)
{
    if(
args  != 2)
    {
        
ReplyToCommand(client"[SM] Usage: sm_fakesay <#userid|name> <text>");
        return 
Plugin_Handled;
    }

    
decl String:Target[64];
    
decl String:text[128];

    
GetCmdArg(1Targetsizeof(Target));
    
GetCmdArg(2textsizeof(text));

    new 
itarget FindTarget(clientTarget);
    if(
itarget == -1)
    {
        
ReplyToCommand(client"Unable to find target");
        return 
Plugin_Handled;
    }
    
CPrintToChatAllEx(itarget"{teamcolor}%N{default} :  %s"itargettext);
    
LogAction(clientitarget"%L made %L say %s "clientitargettext);
    
    return 
Plugin_Handled;


Matter of fact, if you extract Command_Fakesay from this plugin and from fakesay.sp in the FuncommandsX package and remove the whitespace, they're identical.

Code:

public Action:Command_Fakesay(client, args)
{
        if(args  != 2)
        {
                ReplyToCommand(client, "[SM] Usage: sm_fakesay <#userid|name> <text>");
                return Plugin_Handled;
        }

        decl String:Target[64];
        decl String:text[128];

        GetCmdArg(1, Target, sizeof(Target));
        GetCmdArg(2, text, sizeof(text));

        new itarget = FindTarget(client, Target);
        if(itarget == -1)
        {
                ReplyToCommand(client, "Unable to find target");
                return Plugin_Handled;
        }
        //CPrintToChatAllEx(itarget, "{teamcolor}%N{default} :  %s", itarget, text);
        FakeClientCommandEx(itarget, text);
        LogAction(client, itarget, "%L made %L say %s ", client, itarget, text);
        return Plugin_Handled;
}


PepeZukas 03-31-2017 20:23

Re: [Any] FakeSay
 
Does not support letter spacing, for ex:

hi my name is...

Only this:

hi_my_name_is...

Tested on L4D2


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

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