Raised This Month: $ Target: $400
 0% 

amx_slay problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-03-2013 , 05:05   Re: amx_slay problem
Reply With Quote #3

Code about immunity seems ok with cmd_target.
Anyway, i've cleaned up a bit, try it now.
Make sure you have disabled default amx_slay command.

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

#define PLUGIN "plugin_slay"
#define VERSION "1.0"
#define AUTHOR "YANKEE"

public plugin_init() {
   
register_plugin(PLUGINVERSIONAUTHOR)
   
register_concmd("amx_slay""cmdSlay"ADMIN_KICK"<nume> - il omori")
}

public 
cmdSlay(idlevelcid)
{
    if( 
cmd_access(idlevelcid2) )
    {
        new 
arg[32];
        
read_argv arg charsmax(arg) )

        
// #define CMDTARGET_OBEY_IMMUNITY (1<<0)
        // #define CMDTARGET_ALLOW_SELF    (1<<1)
        // #define CMDTARGET_ONLY_ALIVE    (1<<2)
        // #define CMDTARGET_NO_BOTS        (1<<3)
        // 9 is CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS so previous code seemed to be ok
        
new target cmd_target id arg CMDTARGET_OBEY_IMMUNITY CMDTARGET_ALLOW_SELF CMDTARGET_ONLY_ALIVE )

        if( 
target )
        {
            new 
admin[32], name2[32]
            
get_user_name(idadmincharsmax(admin));
            
get_user_name(targetname2charsmax(name2));

            
user_kill(target1)
            
log_amx("Slay: ^"%s^" amx_slay ^"%s^""adminname2)

            
show_activity(idadmin"foloseste comanda amx_slay %s"name2)
        }
    }

    return 
PLUGIN_HANDLED

__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 21:37.


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