Raised This Month: $ Target: $400
 0% 

AutoKick players without making one kill


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
adrsea
Junior Member
Join Date: Mar 2015
Old 03-19-2015 , 07:12   AutoKick players without making one kill
Reply With Quote #1

Can any one create, a plugin to kick all players who died 5 times (or another number) without making one kill? (ex: 0 - 5, (-1) - 4, etc). Number of deaths will be set cvar in amxx.cfg.

Thank you in advance!

Last edited by adrsea; 03-20-2015 at 08:27.
adrsea is offline
monster321
Member
Join Date: Apr 2012
Old 03-19-2015 , 07:38   Re: AutoKick players plugin
Reply With Quote #2

Try it:

Code:
#include < amxmodx > #include < hamsandwich > new deaths[ 33 ], cvar_limit; // Init public plugin_init() {     // Register     register_plugin( "AutoKick Players", "1.0", "monster321" )         // Hams     RegisterHam( Ham_Killed, "player", "HamPlayerKilled" )         // Cvars     cvar_limit = register_cvar( "akp_limit_deaths", "5" ) } // Client connect public client_connect( id )     deaths[ id ] = 0; // HamPlayerKilled public HamPlayerKilled( vic, id, gib ) {     if( !is_user_connected( id ) )         return HAM_IGNORED;         deaths[ vic ] ++;         if( deaths[ vic ] == get_pcvar_num( cvar_limit ) )         server_cmd( "kick #%d ^"[ AKP ] You died %d times^"", get_user_userid( vic ), get_pcvar_num( cvar_limit ) )         return HAM_IGNORED; }
monster321 is offline
Send a message via MSN to monster321 Send a message via Skype™ to monster321
adrsea
Junior Member
Join Date: Mar 2015
Old 03-19-2015 , 08:26   Re: AutoKick players plugin
Reply With Quote #3

It doesn't work because the plugin give kick all players who have score 0 - 5, 1-5, 2-5, 3-5 etc. Not good, I want to give kick only players who died 5 times without making one kill (ZERO). If one player killed someone (one kill), the plugin would not take effect on player (has immunity on plugin). Only players who will not kill anyone (afk, n00bs). If the players wakes from "sleep" and kill someone plugin have no effect (from 1-4 next to 1-5 score, player not receives kick).

Last edited by adrsea; 03-19-2015 at 08:38.
adrsea is offline
adrsea
Junior Member
Join Date: Mar 2015
Old 03-19-2015 , 20:19   Re: AutoKick players plugin
Reply With Quote #4

adrsea is offline
Old 03-20-2015, 01:21
devilicioux
This message has been deleted by devilicioux. Reason: Oops .. didnt see the other requirements in comment..
monster321
Member
Join Date: Apr 2012
Old 03-20-2015 , 14:05   Re: AutoKick players without making one kill
Reply With Quote #5

And this?

Code:
#include < amxmodx > #include < hamsandwich > new deaths[ 33 ], cvar_limit; // Init public plugin_init() {     // Register     register_plugin( "AutoKick Players", "1.0", "monster321" )         // Hams     RegisterHam( Ham_Killed, "player", "HamPlayerKilled" )         // Cvars     cvar_limit = register_cvar( "akp_limit_deaths", "5" ) } // Client connect public client_connect( id )     deaths[ id ] = 0; // HamPlayerKilled public HamPlayerKilled( vic, id, gib ) {     if( !is_user_connected( id ) )         return HAM_IGNORED;         deaths[ vic ] ++;         if( get_user_frags( vic ) == 0 && deaths[ vic ] == get_pcvar_num( cvar_limit ) )         server_cmd( "kick #%d ^"[ AKP ] You died %d times^"", get_user_userid( vic ), get_pcvar_num( cvar_limit ) )         return HAM_IGNORED; }
monster321 is offline
Send a message via MSN to monster321 Send a message via Skype™ to monster321
adrsea
Junior Member
Join Date: Mar 2015
Old 03-21-2015 , 12:25   Re: AutoKick players without making one kill
Reply With Quote #6

Working but I have a requirement. Please make players receive kick with slay and collected died. For example: (-5) - 5 / (-2) - 5. I have auto-slay plugin after a set time and I would like to receive kick for 5 dies whether it committed suicide or killed someone. I hope you understand
adrsea is offline
monster321
Member
Join Date: Apr 2012
Old 03-21-2015 , 16:44   Re: AutoKick players without making one kill
Reply With Quote #7

Try it:

Code:
#include < amxmodx > #include < hamsandwich > new deaths[ 33 ], cvar_limit; // Init public plugin_init() {     // Register     register_plugin( "AutoKick Players", "1.0", "monster321" )         // Events     register_event( "DeathMsg", "ev_deathmsg", "a" )     // Hams     RegisterHam( Ham_Killed, "player", "HamPlayerKilled" )         // Cvars     cvar_limit = register_cvar( "akp_limit_deaths", "5" ) } // Client connect public client_connect( id )     deaths[ id ] = 0; // EV DeathMsg public ev_deathmsg() {     new id, vic;         id = read_data( 1 )     vic = read_data( 2 )         static weapon[ 16 ];     read_data( 4, weapon, sizeof( weapon ) - 1 )         if( !id )     {         if( equal( weapon, "world", 5 ) || equal( weapon, "door", 4 ) || equal( weapon, "trigger_hurt", 12 ) || equal( weapon, "train", 5 ) || equal( weapon, "env_beam", 8 ) || equal( weapon, "env_laser", 9 ) || equal( weapon, "vehicle", 7 ) || equal( weapon, "", 7 ) )         {             deaths[ vic ] ++;             check_deaths( vic )         }     } }     // HamPlayerKilled public HamPlayerKilled( vic, id, gib ) {     if( !is_user_connected( id ) )         return HAM_IGNORED;         deaths[ vic ] ++;     check_deaths( vic )         return HAM_IGNORED; } // Check Deaths public check_deaths( id ) {     if( !is_user_connected( id ) )         return PLUGIN_HANDLED;         if( get_user_frags( id ) == 0 && deaths[ id ] == get_pcvar_num( cvar_limit ) )         server_cmd( "kick #%d ^"[ AKP ] You died %d times^"", get_user_userid( id ), get_pcvar_num( cvar_limit ) )         return PLUGIN_HANDLED; }
monster321 is offline
Send a message via MSN to monster321 Send a message via Skype™ to monster321
adrsea
Junior Member
Join Date: Mar 2015
Old 03-22-2015 , 02:52   Re: AutoKick players without making one kill
Reply With Quote #8

Not work..
adrsea is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-22-2015 , 08:52   Re: AutoKick players without making one kill
Reply With Quote #9

I have a hard time understanding your requirements. The below plugin will kick the player if he gets 5 consecutive deaths without getting 1 kill. If he gets a kill, his death count resets to 0 so the only way a kick can occur is by getting 5 deaths in a row without 1 kill.

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

new const Version[] = "0.1";

const 
MaxPlayers 32;

enum KDCounts
{
    
Kills,
    
Deaths
}

new 
g_PlayerDataMaxPlayers ][ KDCounts ];
new 
g_pDeathLimit;

public 
plugin_init()
{
    
register_plugin"Kick No Kills" Version "bugsy" );
    
    
RegisterHamHam_Killed"player""HamKilled" );
    
    
g_pDeathLimit register_cvar"knk_deathlimit" "5" );
}

public 
client_connectid )
{
    
g_PlayerDataid ][ Kills ] = 0;
    
g_PlayerDataid ][ Deaths ] = 0;
}

public 
HamKilledidVictim idKiller ShouldGib )
{
    new 
iDeathLimit;
    
    if ( 
<= idKiller <= MaxPlayers )
    {
        
g_PlayerDataidKiller ][ Kills ]++;
        
g_PlayerDataidKiller ][ Deaths ] = 0;
    }
    
    
g_PlayerDataidVictim ][ Kills ] = 0;
    
g_PlayerDataidVictim ][ Deaths ]++;
    
    if( !
g_PlayerDataidVictim ][ Kills ] && ( g_PlayerDataidVictim ][ Deaths ] >= ( iDeathLimit get_pcvar_numg_pDeathLimit ) ) ) )
        
server_cmd"kick #%d ^"You died %d times without getting 1 kill^"" get_user_userididVictim ) , iDeathLimit );

__________________

Last edited by Bugsy; 03-22-2015 at 09:03.
Bugsy is offline
adrsea
Junior Member
Join Date: Mar 2015
Old 03-22-2015 , 18:02   Re: AutoKick players without making one kill
Reply With Quote #10

Is not good!

case 1: Score -> 0 - 5 (player have 5 consecutive deaths) => kick
case 2: Score -> -5 - 5 (players have 5 suicide, slay by plugin after a set time or by admin) => kick
case 3: Score -> -2 - 5 (players have 2 suicide and 3 deaths, combined) => kick

............................................. ............................................. ............................etc without getting 1 kill
case 4: Score -> 1 - 4 next to 1 - 5 (player have 1 kill) => No Kick
case 5: Score -> 1 - 4,5,6,7,20,100 (player have 1 kill and 6,7 or 100 deaths) = No kick!!!! because player have 1 kill!


Player gets kick only when the command is applied consecutive (amx_slay, or automatic slay) and deaths (collected) without getting 1 kill. If he does 1 kill the plugin not effect on player remaining time left of map.

Last edited by adrsea; 03-22-2015 at 18:04.
adrsea 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 07:31.


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