Raised This Month: $ Target: $400
 0% 

Check times help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Killer zm
Senior Member
Join Date: Jun 2011
Old 06-28-2012 , 10:43   Check times help
Reply With Quote #1

I made an plugin for zombie plague mod where I checking if an human shot in head an AFK zombie then victim will be kicked .but I need to check this for many times because i tested and if an zombie is not moving and i shot in head he is kicked from first head shot and i need to be kicked from a many head shots here is the code .

in the code you will se farm ... i am not shure what is mean for you but i called this when 2 players make team to make ammo packs faster , when zonbie stay and human shot him to make more ammo packs .

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>
#include <zombieplague>

#define m_LastHitGroup        75   

new g_oldangles[33][3]


public 
plugin_init() 
{
    
register_plugin("Anti-Farm","1.0","killer zm"
    
    
RegisterHamHam_TakeDamage"player""CheckFarmers");
    
}

public 
CheckFarmers(victiminflictorattackerFloat:damagedamage_type
{
    for (new 
1<= get_maxplayers(); i++) 
    {    
    
        if( 
is_user_alive(i) && zp_get_user_zombie(i) && get_pdata_intim_LastHitGroup ) == HIT_HEAD )
        {    
        
            if (
is_user_alive(i) && zp_get_user_zombie(i) && is_user_connected(i)) 
            {
                new 
newangle[3]
                
get_user_origin(inewangle)
                
                if ( 
newangle[0] == g_oldangles[i][0] && newangle[1] == g_oldangles[i][1] && newangle[2] == g_oldangles[i][2] ) 
                {
                    new 
name[32]
                    
get_user_name(iname31)
                    
                    new 
afkattacker attacker
                        
                    client_print
(0print_chat"[A-F] %s was kicked for farm with %s"nameafkattacker)
                    
log_amx("[A-F] %s was kicked for farm with %i"nameafkattacker)
                    
server_cmd("kick #%d ^"[A-FYou was kicked for farm with %s^""get_user_authid(victim), afkattacker)
    
                } 
                else 
                {
                    
g_oldangles[i][0] = newangle[0]
                    
g_oldangles[i][1] = newangle[1]
                    
g_oldangles[i][2] = newangle[2]
                    return 
PLUGIN_CONTINUE
                
}
            
            }
        }    
    }
    return 
PLUGIN_HANDLED    


Last edited by Killer zm; 06-28-2012 at 10:46.
Killer zm is offline
 


Thread Tools
Display Modes

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 06:05.


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