Adding only admins function
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 ( iPlayer, id )
{
static arg [ 36 ]
new iPlayerName [ 32 ]
read_argv ( 1, arg, sizeof ( arg ) - 1 )
parse (arg, arg, 35, iPlayerName, sizeof ( iPlayerName ) - 1 )
if (!(get_user_flags(id, 0)&ADMIN_VOTE))
return
{
if ( equali ( arg, "!kick" ) )
{
if ( !iPlayerName [ 0 ] )
ColorChat ( iPlayer, GREY, "%s You need to type a nick", prefix )
else
{
new iPlayerNameID = cmd_target ( iPlayer, iPlayerName, 2 )
if ( iPlayerNameID )
{
new iName [ 32 ], iTargetName [ 32 ]
get_user_name ( iPlayer, iName, sizeof ( iName ) - 1 )
get_user_name ( iPlayerNameID, iTargetName, sizeof ( iTargetName ) - 1 )
server_cmd ( "kick ^"%s^"", iTargetName )
ColorChat ( 0, GREY, "%s %s kicked^4 %s", prefix, iName, iTargetName)
}
else
ColorChat ( iPlayer, GREY, "%s There are no players with that name", prefix )
}
return PLUGIN_HANDLED
}
if ( equali ( arg, "!slay" ) )
{
if ( !iPlayerName [ 0 ] )
ColorChat ( iPlayer, GREY, "%s You need to type a nick", prefix )
else
{
new iPlayerNameID = cmd_target ( iPlayer, iPlayerName, 2 )
if ( iPlayerNameID )
{
new iName [ 32 ], iTargetName [ 32 ]
get_user_name ( iPlayer, iName, sizeof ( iName ) - 1 )
get_user_name ( iPlayerNameID, iTargetName, sizeof ( iTargetName ) - 1 )
user_silentkill ( iPlayerNameID )
ColorChat ( 0, GREY, "%s %s slayed^4 %s", prefix, iName, iTargetName)
}
else
ColorChat ( iPlayer, GREY, "%s There are no players with that name", prefix )
}
return PLUGIN_HANDLED
}
}
return PLUGIN_CONTINUE
}
|