Raised This Month: $12 Target: $400
 3% 

Last players duel


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dark_style
Senior Member
Join Date: Jul 2009
Location: Bulgaria
Old 10-03-2010 , 08:03   Last players duel
Reply With Quote #1

Hey all

Can someone make code when 1 ct and 1 t from the teams are alive to drop their weapons. I searched and found plugins, but they don't do that what I need.


Sorry for my english. ^^
dark_style is offline
gtpunkt
Veteran Member
Join Date: Dec 2008
Location: Berlin
Old 10-03-2010 , 12:00   Re: Last players duel
Reply With Quote #2

Automatic knife duel
gtpunkt is offline
Send a message via Skype™ to gtpunkt
dark_style
Senior Member
Join Date: Jul 2009
Location: Bulgaria
Old 10-03-2010 , 13:37   Re: Last players duel
Reply With Quote #3

I don't looking for knife duel plugins, I just wanna when they are 1v1 (last CT and T from the teams) to run some function. ;)
dark_style is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 10-03-2010 , 13:44   Re: Last players duel
Reply With Quote #4

Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

public plugin_init()
{
    register_plugin( "Last players", "1.0", "nikhilgupta345" )
    register_event( "DeathMsg", "event_deathmsg", "be" )
}

public event_deathmsg()
{
    new ct, ts
    new players[32], num, id;
    get_players(players, num)
    for(new i;i<num;i++)
    {
        id = players[i]
        if(is_user_alive(id))
        {
            switch(cs_get_user_team(id))
            {
                case CS_TEAM_CT: ct++
                case CS_TEAM_T: ts++
            }
        }
        else return;
    }
    if( ct == 1 && ts == 1)
    {
        for(new i;i<num;i++)
        {
            if(is_user_alive(players[i]))
            {
                strip_user_weapons(players[i])
                give_item(players[i], "weapon_knife")
            }
        }
    }
}
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-03-2010 , 23:45   Re: Last players duel
Reply With Quote #5

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

new const Version[] = "0.1";

new 
bool:bIsDuel;

public 
plugin_init() 
{
    
register_plugin"1v1 Knife Duel" Version "bugsy" );
    
    
register_event"DeathMsg" "fw_EvDeathMsg" "a" "1>0" );
    
register_event"CurWeapon" "fw_EvCurWeapon" "be""1=1" "2!29" );
    
    
register_logevent"RoundEnd" "1=Round_End" );
}

public 
fw_EvDeathMsg()
{
    new 
iPlayers32 ] , iTNum iCTNum iTPlayer iCTPlayer;
    
    
get_playersiPlayers iTNum "ae" "TERRORIST" );
    
    if ( 
iTNum != )
        return 
PLUGIN_CONTINUE;
        
    
iTPlayer iPlayers];

    
get_playersiPlayers iCTNum "ae" "CT" );
        
    if ( 
iCTNum != )
        return 
PLUGIN_CONTINUE;
        
    
iCTPlayer iPlayers];
    
    
strip_user_weaponsiTPlayer );
    
give_itemiTPlayer "weapon_knife" );
    
    
strip_user_weaponsiCTPlayer );
    
give_itemiCTPlayer "weapon_knife" );

    
bIsDuel true;
    
    return 
PLUGIN_CONTINUE;
}

public 
fw_EvCurWeaponid )
{
    if ( 
bIsDuel )
        
engclient_cmdid "weapon_knife" );
}

public 
RoundEnd()
{
    
bIsDuel false;

__________________
Bugsy is offline
Reply


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 11:18.


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