Raised This Month: $ Target: $400
 0% 

[SNIP] Fake client cmd through console


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
thacursedpie
Member
Join Date: May 2008
Old 09-21-2009 , 14:55   [SNIP] Fake client cmd through console
Reply With Quote #1

This is actually a working plug-in, but so small that I decided to post it here (plus half of it isn't even done by me)
What it does: take the client name and the cmd, then execute it.
(it also requires the Slay flag, else stuff would get out of hand )
I took the player-recognizing-thingy from the standard No-Clip plugin, so credits to whoever made that.

It can be helpful when working with bots or when you want to abuse your precious admin-powers
PHP Code:
#include <sourcemod>
#include <sdktools>

public OnPluginStart()
{
    
RegAdminCmd("sm_fakeclientcmd"Command_remotecmdADMFLAG_SLAY"[SM] Usage: sm_remotecmd <#userid|name> <command>");
}
       
public 
Action:Command_remotecmd(clientargs)
{    
    if (
args 1) {
        
ReplyToCommand(client"[SM] Usage: sm_fakeclientcmd <#userid|name> <command>");
        return 
Plugin_Handled;
    }
    else if (
args 2) {
        
ReplyToCommand(client"[SM] Usage: sm_fakeclientcmd <#userid|name> <command>");
        return 
Plugin_Handled;
    }
    
    
decl String:arg[256];
    
decl String:cmd[256];
    
GetCmdArg(1argsizeof(arg));
    
GetCmdArg(2cmdsizeof(cmd));
    
decl String:target_name[MAX_TARGET_LENGTH];
    
decl target_list[MAXPLAYERS], target_countbool:tn_is_ml;
    
    if ((
target_count ProcessTargetString(
            
arg,
            
client,
            
target_list,
            
MAXPLAYERS,
            
COMMAND_FILTER_ALIVE,
            
target_name,
            
sizeof(target_name),
            
tn_is_ml)) <= 0)
    {
        
ReplyToCommand(client"[SM] no matching client was found");
        return 
Plugin_Handled;
    }
    
    for (new 
0target_counti++)
    {
        
FakeClientCommand(target_list[i], cmd);
    }
    return 
Plugin_Handled;

thacursedpie is offline
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 09-21-2009 , 14:58   Re: [SNIP] Fake client cmd through console
Reply With Quote #2

Same as this one?
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
thacursedpie
Member
Join Date: May 2008
Old 09-22-2009 , 11:28   Re: [SNIP] Fake client cmd through console
Reply With Quote #3

Quote:
Originally Posted by exvel View Post
Same as this one?
It's not the "same" (considering I made mine myself), but it really does the same thing. I had a quick look at the source-code of that plugin and it's very similar.

Haha, quite funny . Guess this thread can be locked or something
thacursedpie 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 14:06.


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