Raised This Month: $ Target: $400
 0% 

Slay on TK


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ardonicek
Senior Member
Join Date: Feb 2013
Location: My home
Old 08-26-2013 , 15:37   Slay on TK
Reply With Quote #1

Hello, i'm looking for simple code which will slay teamkiller.

Example: Player 1 teamkilled Player 2... Player 1 has been slain.

I don't know how to do it, thanks.
__________________
Latest plugin: dHUD Round | Timeleft
Ardonicek is offline
Send a message via ICQ to Ardonicek Send a message via Skype™ to Ardonicek
sami_spt
Veteran Member
Join Date: Sep 2012
Location: I<3 pussy cats
Old 08-26-2013 , 15:49   Re: Slay on TK
Reply With Quote #2

amx_cvar mp_tkpunish 1

this will slay him nxt round..

if u need in the same round, then wait for some1..

Last edited by sami_spt; 08-26-2013 at 15:50.
sami_spt is offline
Ardonicek
Senior Member
Join Date: Feb 2013
Location: My home
Old 08-26-2013 , 15:53   Re: Slay on TK
Reply With Quote #3

I need it in the same round.
__________________
Latest plugin: dHUD Round | Timeleft
Ardonicek is offline
Send a message via ICQ to Ardonicek Send a message via Skype™ to Ardonicek
sonel
Member
Join Date: Jul 2012
Old 08-26-2013 , 16:07   Re: Slay on TK
Reply With Quote #4

http://forums.alliedmods.net/showthread.php?p=157579
sonel is offline
Ardonicek
Senior Member
Join Date: Feb 2013
Location: My home
Old 08-26-2013 , 16:36   Re: Slay on TK
Reply With Quote #5

I don't want ATAC, i just want simple code.
__________________
Latest plugin: dHUD Round | Timeleft
Ardonicek is offline
Send a message via ICQ to Ardonicek Send a message via Skype™ to Ardonicek
tonykaram1993
Senior Member
Join Date: Mar 2013
Location: This World
Old 08-26-2013 , 17:18   Re: Slay on TK
Reply With Quote #6

Try this, I wrote it quickly. It compiles fine but it's not tested.

PHP Code:
/*
    TK Slayer
    by tonykaram1993
    
    This will simpy kill a player if he killed his own team-mate.
    No options to configure, just install and play.
*/

/* Includes */
#include < amxmodx >
#include < hamsandwich >

/* Plugin Natives */
public plugin_init( ) {
    
register_plugin"TK Slayer""0.0.1""tonykaram1993" );
    
    
RegisterHamHam_Killed,        "player",        "Ham_Killed_Player_Post",        true );
}

/* Ham Hooks */
public Ham_Killed_Player_PostiVictimiKilleriShouldGib ) {
    if( 
get_user_teamiVictim ) == get_user_teamiKiller ) ) {
        
user_killiKiller );
        
        
client_printiKillerprint_center"You have been killed for killing your team-mate" );
    }

__________________
My Plugins:
UltimatePlugin
UltimateSurf
UltimateAdmin
Code:
rcon version | rcon amxx version | rcon meta version
rcon amxx plugins | rcon meta list | rcon status
I AM INACTIVE ON THIS FORUM - For direct contact: [email protected]
tonykaram1993 is offline
Ardonicek
Senior Member
Join Date: Feb 2013
Location: My home
Old 08-26-2013 , 23:42   Re: Slay on TK
Reply With Quote #7

Quote:
Originally Posted by tonykaram1993 View Post
Try this, I wrote it quickly. It compiles fine but it's not tested.

PHP Code:
/*
    TK Slayer
    by tonykaram1993
    
    This will simpy kill a player if he killed his own team-mate.
    No options to configure, just install and play.
*/

/* Includes */
#include < amxmodx >
#include < hamsandwich >

/* Plugin Natives */
public plugin_init( ) {
    
register_plugin"TK Slayer""0.0.1""tonykaram1993" );
    
    
RegisterHamHam_Killed,        "player",        "Ham_Killed_Player_Post",        true );
}

/* Ham Hooks */
public Ham_Killed_Player_PostiVictimiKilleriShouldGib ) {
    if( 
get_user_teamiVictim ) == get_user_teamiKiller ) ) {
        
user_killiKiller );
        
        
client_printiKillerprint_center"You have been killed for killing your team-mate" );
    }

It's 50 AM here, so i didn't test it with player, but i tried to write kill into console to test something and the message appeared.
Not sure if it killed me twice.
Please, fix.
__________________
Latest plugin: dHUD Round | Timeleft
Ardonicek is offline
Send a message via ICQ to Ardonicek Send a message via Skype™ to Ardonicek
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 08-27-2013 , 00:48   Re: Slay on TK
Reply With Quote #8

try this [compiler fine]
PHP Code:
#include < amxmodx > 
#include < hamsandwich > 

new g_iMaxPlayers

/* Plugin Natives */ 
public plugin_init( ) { 
    
register_plugin"TK Slayer""0.0.1""tonykaram1993" ); 
     
    
RegisterHamHam_Killed"player""Ham_Killed_Player_Post"true ); 
    
    
g_iMaxPlayers get_maxplayers()


/* Ham Hooks */ 
public Ham_Killed_Player_PostiVictimiKilleriShouldGib )

    if( !( 
<= iKiller <= g_iMaxPlayers ) || !is_user_alive(iKiller) || iVictim == iKiller)
    {
        return;
    }

    if( 
get_user_teamiVictim ) == get_user_teamiKiller ) ) { 
        
user_killiKiller ); 
         
        
client_printiKillerprint_center"You have been killed for killing your team-mate" ); 
    } 

__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.
pokemonmaster is offline
Ardonicek
Senior Member
Join Date: Feb 2013
Location: My home
Old 08-27-2013 , 01:26   Re: Slay on TK
Reply With Quote #9

Doesn't seem to work on awesome_cars2
__________________
Latest plugin: dHUD Round | Timeleft
Ardonicek is offline
Send a message via ICQ to Ardonicek Send a message via Skype™ to Ardonicek
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 08-27-2013 , 02:25   Re: Slay on TK
Reply With Quote #10

Try this again not tested
PHP Code:
#include < amxmodx > 
#include < hamsandwich > 
#include < fakemeta >

new g_iMaxPlayers

/* Plugin Natives */ 
public plugin_init( ) { 
    
register_plugin"TK Slayer""0.0.1""tonykaram1993" ); 
     
    
RegisterHamHam_Killed"player""Ham_Killed_Player_Post"true ); 
    
    
g_iMaxPlayers get_maxplayers()


/* Ham Hooks */ 
public Ham_Killed_Player_PostiVictimiKilleriShouldGib )

    if( !( 
<= iKiller <= g_iMaxPlayers ) )
    {
        if(
IsEntVehicle(iKiller))
        {
            
iKiller pev(iKillerpev_iuser4)
        }

        if(!
iKiller || !is_user_connected(iKiller))
        {
            return;
        }
    }

    if(!
is_user_alive(iKiller) || iVictim == iKiller )
    {
        return;
    }

    if( 
get_user_teamiVictim ) == get_user_teamiKiller ) ) { 
        
user_killiKiller ); 
         
        
client_printiKillerprint_center"You have been killed for killing your team-mate" ); 
    } 
}  

stock IsEntVehicle(iEnt)
{
    static const 
szVehicleClassName[] = "func_vehicle"

    
static szEntClassName[32]
    
pev(iEntpev_classnameszEntClassName31)

    if(
equal(szEntClassNameszVehicleClassName))
    {
        return 
1
    
}

    return 
0

__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.

Last edited by pokemonmaster; 08-27-2013 at 02:26.
pokemonmaster 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 06:50.


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