Raised This Month: $ Target: $400
 0% 

Pass player if attacked?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
zacky
Senior Member
Join Date: Mar 2008
Location: Sweden
Old 09-01-2009 , 17:46   Re: Pass player if attacked?
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
Try this (untested):

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

public plugin_init()
{
    
register_plugin("Plugin Name""1.0""Author");
    
// register_event("DeathMsg", "EVENT_TakeDamage", "be")
    
RegisterHam(Ham_TakeDamage"player""EVENT_TakeDamage")
}

public 
EVENT_TakeDamage(idvictimidinflictoridattackerFloat:damagedamagebits)
{
    if( 
idvictim 33 && idattacker 33 )
    {
        new 
iPlayerCount get_playersnum()
        new 
CsTeams:TeamVictim cs_get_user_team(idvictim)
        new 
CsTeams:TeamAttacker cs_get_user_team(idattacker)
        
        if( 
iPlayerCount && TeamVictim != TeamAttacker )
        {
            switch( 
_:TeamVictim )
            {
                case 
CS_TEAM_CT:
                {
                    
cs_set_user_team(idvictimCS_TEAM_T)
                    
client_print(0print_chat"Hahaha. A Counter-Terrorist has been captured by the Terrorists.")
                }
                case 
CS_TEAM_T:
                {
                    
cs_set_user_team(idvictimCS_TEAM_CT)
                    
client_print(0print_chat"Hahaha. A Terrorist has been captured by the Counter-Terrorists.")
                }
            }
        }
    }

    return 
HAM_SUPERCEDE

You forgot captured(id) from his code.
zacky is offline
Send a message via Skype™ to zacky
 



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


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