Raised This Month: $ Target: $400
 0% 

[Help] handle_say.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nakash
Member
Join Date: Jan 2009
Old 08-03-2010 , 02:15   [Help] handle_say.
Reply With Quote #1

Hey guys. I searched everywhere but couldn't find a good solution for this.
I want to kick someone using a chat command, I mean something like this;

Quote:
!kick PLAYER
Quote:
[SERVER] %s has been kicked by %s.
I know that I should use handle say but I don't know how to use it with parameters.

Also, if possible, I want to change map with this command;
Quote:
!map de_dust2
Quote:
[SERVER] %s has changed the map to %s
Thanks in advance.




Last edited by nakash; 08-03-2010 at 04:12.
nakash is offline
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 08-03-2010 , 15:34   Re: [Help] handle_say.
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Kick"
#define VERSION "1.0"
#define AUTHOR "Mxnn"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say""handle_say")
}

public 
handle_say(id) {
    
    if(
get_user_flags(id) & ADMIN_KICK)
        return 
PLUGIN_CONTINUE
        
    
new said[64], player[32]
    
read_args(said63)
    
remove_quotes(said)
    
    if (
said[0] == ' ')
        return 
PLUGIN_CONTINUE
    
else
        
strtok(saidsaid63player31' ')
        
    if (!
equal(said"!kick"))
        return 
PLUGIN_CONTINUE
    
    
new user cmd_target(idplayer2)
    
    if (!
user) {
        
client_print(idprint_chat"[AMXX] User not found")
        return 
PLUGIN_CONTINUE
    
}
    
    new 
szTargetName[32], szAdminName[32]
    
get_user_name(idszAdminName31)
    
get_user_name(userszTargetName31)
    
    
client_print(0print_chat"[AMXX] Admin %s KICK %s"szAdminNameszTargetName)
    
server_cmd("kick #%d"user)
    
    return 
PLUGIN_HANDLED
    

Try to do the same with "!map"
Mxnn is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-03-2010 , 16:08   Re: [Help] handle_say.
Reply With Quote #3

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define VERSION "0.0.1"

public plugin_init()
{
    
register_plugin("Say Cmds"VERSION"ConnorMcLeod")

    
register_clcmd("say""ClientCommand_Say")
    
register_clcmd("say_team""ClientCommand_Say")
}

public 
ClientCommand_Sayid )
{
    if( 
is_user_admin(id) )
    {
        new 
szSaid[192]
        
read_argv(1szSaidcharsmax(szSaid))
        if( 
szSaid[0] == '!' )
        {
            
client_cmd(id"amx_%s"szSaid[1])
            return 
PLUGIN_HANDLED
        
}
    }
    return 
PLUGIN_CONTINUE

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 08-03-2010 at 16:23.
ConnorMcLeod is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-03-2010 , 19:13   Re: [Help] handle_say.
Reply With Quote #4

And ConnorMcLeod wins!
__________________
fysiks is offline
katna
Senior Member
Join Date: May 2010
Old 08-03-2010 , 15:53   Re: [Help] handle_say.
Reply With Quote #5

PHP Code:
#include <amxmodx>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new const AmxCmds[][]= { "ct","t","roundtime","ft","freezetime","revive","restart","rr","gag","ungag","bury",
"unbury","rocket","kick","ban","slay","slap","map","glow""noclip""godmode""pause",
"heal""weapon""ff","pass","nopass""gravity","aa","alltalk""restartserver" }


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

public 
HandleSay(id) {
    new 
message[128];
    
read_argv(1message127);
    for(new 
i=0;i<sizeof(AmxCmds);i++) {
        new 
cmd[33];
        
formatex(cmd,32,"!%s",AmxCmds[i])
        if(
containi(message,cmd) == 0) {
            if(!(
get_user_flags(id) & ADMIN_CVAR))
                return 
PLUGIN_CONTINUE;
            
HandleChatCmd(id,i);
            return 
PLUGIN_HANDLED;
        }
    }
    return 
PLUGIN_CONTINUE;
}

public 
HandleChatCmd(idtype) {
    new 
message[128], cmd[33], arg[65], arg2[65], name[32];
    
read_argv (1message128);
    
get_user_name(id,name,31);
    
parse(message,cmd,32,arg,64,arg2,64);
    
    switch(
type) {
        case 
1// !ct
        
case 2// !t
        
case 3// !roundtime
        
case 4,5// !ft,!freezetime
        // and you keep continue...
    
}

katna is offline
GarbageBox
Senior Member
Join Date: Feb 2010
Old 08-04-2010 , 00:47   Re: [Help] handle_say.
Reply With Quote #6

I think so too.
__________________
You can be a SUPER coder but you Haven't to say such as "stupid, etc." words to the others
GarbageBox is offline
nakash
Member
Join Date: Jan 2009
Old 08-04-2010 , 03:12   Re: [Help] handle_say.
Reply With Quote #7

Hehe thank you very much guys!
nakash is offline
Reply



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 00:07.


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