Raised This Month: $ Target: $400
 0% 

Adding only admins function


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
fLaXXiE
Member
Join Date: Apr 2011
Old 05-15-2011 , 15:33   Adding only admins function
Reply With Quote #1

I need to add only admins function. i tried but was not correct.

PHP Code:
#include < amxmodx >
#include < amxmisc >
#include < colorchat >
#include < engine >
#include < fun >

#define prefix "^4[FB] Manager:^3"

public plugin_init ( )
{
    
register_plugin "JBManager""1.0""Capell" )
    
    
register_clcmd "say""SayCmds" )
}

public 
SayCmds iPlayerid )
{
    static 
arg 36 ]
    new 
iPlayerName 32 ]
    
read_argv 1argsizeof arg ) - )
    
parse (argarg35iPlayerNamesizeof iPlayerName ) - )

    if (!(
get_user_flags(id0)&ADMIN_VOTE))
        return
    {    
        if ( 
equali arg"!kick" ) )
        {
            if ( !
iPlayerName ] )
                
ColorChat iPlayerGREY"%s You need to type a nick"prefix )
            else
            {
                new 
iPlayerNameID cmd_target iPlayeriPlayerName)
                if ( 
iPlayerNameID )
                {
                    new 
iName 32 ], iTargetName 32 ]
                    
get_user_name iPlayeriNamesizeof iName ) - )
                    
get_user_name iPlayerNameIDiTargetNamesizeof iTargetName ) - )
                    
server_cmd "kick ^"%s^""iTargetName )
                    
ColorChat 0GREY"%s %s kicked^4 %s"prefixiNameiTargetName)
                }
                else
                    
ColorChat iPlayerGREY"%s There are no players with that name"prefix )
            }
            return 
PLUGIN_HANDLED
        
}
    
        if ( 
equali arg"!slay" ) )
        {
            if ( !
iPlayerName ] )
                
ColorChat iPlayerGREY"%s You need to type a nick"prefix )
            else
            {
                new 
iPlayerNameID cmd_target iPlayeriPlayerName)
                if ( 
iPlayerNameID )
                {
                    new 
iName 32 ], iTargetName 32 ]
                    
get_user_name iPlayeriNamesizeof iName ) - )
                    
get_user_name iPlayerNameIDiTargetNamesizeof iTargetName ) - )
                    
user_silentkill iPlayerNameID )
                    
ColorChat 0GREY"%s %s slayed^4 %s"prefixiNameiTargetName)
                }
                else
                    
ColorChat iPlayerGREY"%s There are no players with that name"prefix )
            }
            return 
PLUGIN_HANDLED
        
}
    
    }
        return 
PLUGIN_CONTINUE

fLaXXiE is offline
Send a message via MSN to fLaXXiE Send a message via Skype™ to fLaXXiE
 



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


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