AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   admin plugin !slap !slay... (https://forums.alliedmods.net/showthread.php?t=288289)

jackdaniel 09-26-2016 05:05

admin plugin !slap !slay...
 
Hello
I find in some servers that admin or vip can slap or slay or kick just using
this command in chat he type in chat like !slap player ..!slay player ... !votekick player
can you please gave me the plugin name
and thank you

ish12321 09-26-2016 06:58

Re: admin plugin !slap !slay...
 
Just you need to assign say !slap also to function of amx_slap

This would do it :)

Blizzard_87 09-26-2016 07:22

Re: admin plugin !slap !slay...
 
this plugin exist on this forum just need to search.

jackdaniel 09-26-2016 07:44

Re: admin plugin !slap !slay...
 
Quote:

Originally Posted by ish12321 (Post 2457137)
Just you need to assign say !slap also to function of amx_slap

This would do it :)

its not work need a plugin for that

jackdaniel 09-26-2016 07:46

Re: admin plugin !slap !slay...
 
Quote:

Originally Posted by Blizzard_87 (Post 2457141)
this plugin exist on this forum just need to search.

I tried to search in forum but i didnt find anything in forum theres more than 30 000 plugin its so hard to find it

Sanjay Singh 09-26-2016 08:39

Re: admin plugin !slap !slay...
 
i have this plugin same as u want :)

Sanjay Singh 09-26-2016 08:43

Re: admin plugin !slap !slay...
 
PHP Code:

#include <amxmodx>

#define MAX_NAME_LENGTH 32
#define MAX_TEXT_LENGTH 192
#define MAX_PLAYERS 32

public admin_slash(id)
{
    new 
sName[MAX_NAME_LENGTH+1]
    new 
sArg[MAX_NAME_LENGTH+1]
    
    
read_argv(1,sArg,MAX_NAME_LENGTH)
    
    
// Check for '/' char
    
if ( sArg[0] == '/' ) {
        
        new 
sCommand[MAX_TEXT_LENGTH+1]
        new 
sMessage[MAX_TEXT_LENGTH+1]
        new 
sTemp[MAX_TEXT_LENGTH+1]
        
        
read_args(sMessage,MAX_TEXT_LENGTH)
        
remove_quotes(sMessage)
        
replace(sMessage,MAX_TEXT_LENGTH,"/","")
        
        if ( 
containi(sMessage,"@all") != -) {
            
            new 
iPlayers[MAX_PLAYERS], iNumPlayers
            get_players
(iPlayers,iNumPlayers)
            
            for (new 
0iNumPlayersi++) {
                
                
get_user_name(iPlayers[i],sName,MAX_NAME_LENGTH)
                
                
copy(sTemp,MAX_TEXT_LENGTH,sMessage)
                
replace(sTemp,MAX_TEXT_LENGTH,"@all","^"@name^"")
                
replace(sTemp,MAX_TEXT_LENGTH,"@name",sName)
                
format(sCommand,MAX_TEXT_LENGTH,"amx_%s",sTemp)
                
client_cmd(id,sCommand)
                
            }
            
copyc(sCommand,MAX_NAME_LENGTH,sTemp,' ')
            
client_print(id,print_chat,"[AMXX] Command ^"%s^" executed on all players",sCommand)
        }
        
        else if ( 
containi(sMessage,"@team:") != -) {
            
            new 
sTeam[MAX_NAME_LENGTH+1]
            new 
sRemove[MAX_TEXT_LENGTH+1]
            
            
copy(sTemp,MAX_TEXT_LENGTH,sMessage)
            
copyc(sRemove,MAX_TEXT_LENGTH,sTemp,'@')
            
replace(sTemp,MAX_TEXT_LENGTH,sRemove,"")
            
copyc(sTeam,MAX_TEXT_LENGTH,sTemp,' ')
            
            if ( 
containi(sTeam,"@team:") != -) {
                
                
replace(sMessage,MAX_TEXT_LENGTH,sTeam,"^"@name^"")
                
replace(sTeam,MAX_TEXT_LENGTH,"@team:","")
                
                if ( 
equal(sTeam,"T") ) {
                    
copy(sTeam,MAX_NAME_LENGTH,"TERRORIST")
                }
                else if ( 
equal(sTeam,"S") ) {
                    
copy(sTeam,MAX_NAME_LENGTH,"SPECTATOR")
                }
            }
            else {
                
client_print(id,print_chat,"[AMXX] Team identifier not recognized")
                return 
PLUGIN_HANDLED
            
}
            
            new 
iPlayers[MAX_PLAYERS], iNumPlayers
            get_players
(iPlayers,iNumPlayers,"e",sTeam)
            
            if ( 
iNumPlayers ) {
                
                for (new 
0iNumPlayersi++) {
                    
                    
get_user_name(iPlayers[i],sName,MAX_NAME_LENGTH)
                    
                    
copy(sTemp,MAX_TEXT_LENGTH,sMessage)
                    
replace(sTemp,MAX_TEXT_LENGTH,"@name",sName)
                    
format(sCommand,MAX_TEXT_LENGTH,"amx_%s",sTemp)
                    
client_cmd(id,sCommand)
                }
                
copyc(sCommand,MAX_NAME_LENGTH,sTemp,' ')
                
client_print(id,print_chat,"[AMXX] Command ^"%s^" executed on team ^"%s^"",sCommand,sTeam)
            }
            
            else     {
                
client_print(id,print_chat,"[AMXX] There are no players on team ^"%s^"",sTeam)
            }
        }
        
        else     {
            
format(sCommand,MAX_TEXT_LENGTH,"amx_%s",sMessage)
            
client_cmd(id,sCommand)
        }
        
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE
}

public 
plugin_init()
{
    
register_plugin("Admin Slash","1.2","mike_cao")
    
register_clcmd("say","admin_slash",0,"say /command < params >")
    return 
PLUGIN_CONTINUE



Sanjay Singh 09-26-2016 08:43

Re: admin plugin !slap !slay...
 
Just Replace / with ! thatsit

Relaxing 09-26-2016 14:12

Re: admin plugin !slap !slay...
 
Try this ->

PHP Code:

#include < amxmodx >

#define PLUGIN "CFG"
#define VERSION "1.0"
#define AUTHOR "aNNakin"

new const g_Char[ ] = "!";

new 
g_Commands[ ][ ] =
{
    
"!kick",
    
"!slay",
    
"!ban",
    
"!banip"
};

new 
g_Accesses[ ] =
{
    
ADMIN_KICK,
    
ADMIN_SLAY,
    
ADMIN_BAN,
    
ADMIN_BAN
};

public 
plugin_init ( )
{
    
register_plugin PLUGINVERSIONAUTHOR );
    
register_clcmd "say""hook_say" );
}

public 
hook_say e_Index )
{
    static 
s_Args192 ], s_Command192 ];
    
read_args s_Argscharsmax s_Args ) );
    
    if ( ! 
s_Args] )
        return 
PLUGIN_CONTINUE;
    
remove_quotes s_Args] );
    
    for ( new 
isizeof g_Commandsi++ )
    {
        if ( 
equal s_Argsg_Commands], strlen g_Commands] ) ) )
        {
            if ( 
get_user_flags e_Index ) & g_Accesses] )
            {
                
replace s_Argscharsmax s_Args ), g_Char"" );
                
formatex s_Commandcharsmax s_Command ),"amx_%s"s_Args );
                
client_cmd e_Indexs_Command );
            }
            
            break;
        }
    }
    
    return 
PLUGIN_CONTINUE;




All times are GMT -4. The time now is 17:13.

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