Raised This Month: $ Target: $400
 0% 

* How Kick a Player? *


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
D3v1L
Junior Member
Join Date: Jun 2010
Old 06-17-2010 , 12:13   * How Kick a Player? *
Reply With Quote #1

Hello all!

Who can help me and fix it? I need, if an admin say in chat, but not in console:
  • .kick <username> - and <username> will be kicked.

I have scripted, but it doesn't works. Here is a code:
Code:
/* Edited Code */
/* ********* */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN    "Kick Plugin"
#define VERSION    "0.1"
#define AUTHOR    "D3v1L"

#define ACCESS    ADMIN_KICK
#define PREFIX    "[NEF]"

new g_kickCmd[] = ".kick"
new g_fCvarMsg

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_clcmd("say", "cmd_Kick")
    g_fCvarMsg = register_cvar("amx_show_msg_1all_0id", "1")
}

public cmd_Kick(id)
{
    new args[32]
    read_args(args, charsmax(args))

    new target = cmd_target(id, args, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF)

    if (!target)
        return PLUGIN_CONTINUE

    new admin_name[32], target_name[32]
    get_user_name(id, admin_name, charsmax(admin_name))
    get_user_name(target, target_name, charsmax(target_name))

    new fix[192]
    format(fix, charsmax(fix), "%s", target)

    if (containi(args, g_kickCmd) != -1 && containi(args, fix) != -1)
    {
        if (!access(id, ACCESS))
        {
            client_print(id, print_chat, "%s You have no access to that command.", PREFIX)
            return PLUGIN_HANDLED
        }

        server_cmd("kick #%d", get_user_userid(target))
        client_print(get_pcvar_num(g_fCvarMsg) ? 0 : id, print_chat, "%s Admin %s: kicked %s", PREFIX, admin_name, target_name)
    }

    return PLUGIN_CONTINUE
}
Sorry for my very bad english.
Thanks for all!

Last edited by D3v1L; 06-17-2010 at 15:51.
D3v1L is offline
 



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:48.


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