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

! plugin find


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Author Message
iron_sniper
New Member
Join Date: Aug 2006
Old 08-15-2006 , 18:10   ! plugin find
#1

im looking for the plugin that allows an admin to say "!slap name" and the command is executed.

the "!" replaces amx_ and it doesnt require console

Last edited by iron_sniper; 08-15-2006 at 18:24.
iron_sniper is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 08-15-2006 , 18:22   Re: ! plugin find
#2

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]

        
// Get data
        
read_args(sMessage,MAX_TEXT_LENGTH)
        
remove_quotes(sMessage)
        
replace(sMessage,MAX_TEXT_LENGTH,"!","")
        
        
// For all players
        
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,"[AMX] Command ^"%s^" executed on all players",sCommand)
        }
        
// For a team
        
else if ( containi(sMessage,"@team:") != -) {
            new 
sTeam[MAX_NAME_LENGTH+1]
            new 
sRemove[MAX_TEXT_LENGTH+1]

            
// Get team
            
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:","")

                
// Shortcuts for Counter-strike
                
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,"[AMX] 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,"[AMX] Command ^"%s^" executed on team ^"%s^"",sCommand,sTeam)
            }
            else {
                
client_print(id,print_chat,"[AMX] 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 
admin_me(id)
{
    new 
sName[MAX_NAME_LENGTH+1]
    new 
sMessage[MAX_TEXT_LENGTH+1]
    
    
// Get data
    
get_user_name(id,sName,MAX_NAME_LENGTH)
    
read_args(sMessage,MAX_TEXT_LENGTH)
    
remove_quotes(sMessage)

    
// Display message only to same status players
    
new bAlive is_user_alive(id)
    for (new 
1<= MAX_PLAYERSi++) {
        if(
is_user_alive(i) == bAlive) {
            
client_print(i,print_chat,"%s %s",sName,sMessage)
        }
    }
    return 
PLUGIN_HANDLED
}

public 
admin_getteam(id)
{
    
// Check arguments
    
if (read_argc() < 2) {
        
client_print(idprint_console,"[AMX] Usage: amx_getteam < authid | part of name >")
        return 
PLUGIN_HANDLED
    
}
    
    
// Find target player
    
new arg[MAX_NAME_LENGTH+1]
    
read_argv(1,arg,MAX_NAME_LENGTH)
    new 
player find_player("c",arg)
    if (!
playerplayer find_player("bl",arg)
    
    
// Player checks
    
if (player)    {
        new 
sName[MAX_NAME_LENGTH+1]
        new 
sTeam[MAX_NAME_LENGTH]
        
get_user_name(player,sName,MAX_NAME_LENGTH)
        
get_user_team(player,sTeam,MAX_NAME_LENGTH);
        
client_print(id,print_chat,"[AMX] %s's team is ^"%s^"",sName,sTeam)
    }
    else {
        
client_print(id,print_console,"[AMX] Client with that authid or part of name not found")
    }
    return 
PLUGIN_HANDLED
}

public 
plugin_init()
{
    
register_plugin("Admin !","1.1","mike_cao")
    
register_clcmd("say","admin_slash",0,"say !command < params >")
    
register_clcmd("amx_me","admin_me",0,"amx_me < text >")
    
register_clcmd("amx_getteam","admin_getteam",0,"amx_getteam < authid | part of nick >")
    return 
PLUGIN_CONTINUE


Last edited by SweatyBanana; 08-15-2006 at 18:56.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
iron_sniper
New Member
Join Date: Aug 2006
Old 08-15-2006 , 18:26   Re: ! plugin find
#3

ok where do i put that
iron_sniper is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 08-15-2006 , 18:42   Re: ! plugin find
#4

You shouldnt be running a server with amxmodx if you havent read the doc yet.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Kryptic
Member
Join Date: Jun 2006
Location: Vermont
Old 08-15-2006 , 18:52   Re: ! plugin find
#5

Instead of ! try / . Theres a plugin for it. Look up Admin Slash.
Kryptic is offline
Send a message via ICQ to Kryptic Send a message via AIM to Kryptic
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 08-15-2006 , 18:54   Re: ! plugin find
#6

iF you even looked at what I posted, you would already see that I changed the / plugin to use !...
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Kryptic
Member
Join Date: Jun 2006
Location: Vermont
Old 08-15-2006 , 19:05   Re: ! plugin find
#7

I dunno how to code... So I dont really look at those things lol...

Not much of an excuse, but hey.
Kryptic is offline
Send a message via ICQ to Kryptic Send a message via AIM to Kryptic
iron_sniper
New Member
Join Date: Aug 2006
Old 08-15-2006 , 20:03   Re: ! plugin find
#8

my browser shows me php code, how do i compile that into anything, or is there a file that i can get somewhere
iron_sniper is offline
ThomasNguyen
Senior Member
Join Date: May 2006
Old 08-15-2006 , 20:37   Re: ! plugin find
#9

1. right click on desktop and make a new "text document"
2. Copy the code banana posted up there.
3. paste it in the text document.
4. click file.
5. save as...
6. save it as quickcmd.sma (its just an example)
7. go down to the next drop down box and set it on "all files"
8. press ok.
9. drag it into your scripting folder.
10. drag the .sma into the compile icon. (its blue)
__________________
ThomasNguyen is offline
mpDOTcain
Member
Join Date: Jul 2006
Old 08-16-2006 , 02:41   Re: ! plugin find
#10

perhaps not the most help but to get admin slash search for super under plugins and click the amx super everything you need plugin, you can download admin slash at the bottom of the first post.

its exactally what you want except using / instead of !
mpDOTcain is offline
Closed Thread



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 01:31.


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