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

[REQ] Detect no kill and punish ( Players which is not killing the enemies)


Post New Thread Reply   
 
Thread Tools Display Modes
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 11-02-2017 , 15:40   Re: [REQ] Detect no kill and punish ( Players which is not killing the enemies)
Reply With Quote #21

I'll call bugsy...
__________________
Relaxing is offline
Old.School
Senior Member
Join Date: Sep 2015
Location: France
Old 11-09-2017 , 15:37   Re: [REQ] Detect no kill and punish ( Players which is not killing the enemies)
Reply With Quote #22

-.- where is it!
__________________
You keep bringing B.R down .. He will rise again and kick Enemies asses !
Old.School is offline
Alber9091
Veteran Member
Join Date: Jun 2014
Location: Karachi, Pakistan
Old 11-11-2017 , 10:15   Re: [REQ] Detect no kill and punish ( Players which is not killing the enemies)
Reply With Quote #23

https://forums.alliedmods.net/showthread.php?t=924

Is this gonna help?
Alber9091 is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 11-11-2017 , 12:31   Re: [REQ] Detect no kill and punish ( Players which is not killing the enemies)
Reply With Quote #24

Quote:
Originally Posted by Alber9091 View Post
Quote:
Originally Posted by Relaxing View Post
Worng, Incorrect
__________________
Relaxing is offline
Old 11-11-2017, 14:04
Alber9091
This message has been deleted by Alber9091. Reason: nvm
Alber9091
Veteran Member
Join Date: Jun 2014
Location: Karachi, Pakistan
Old 11-11-2017 , 14:07   Re: [REQ] Detect no kill and punish ( Players which is not killing the enemies)
Reply With Quote #25

Quote:
Originally Posted by Relaxing View Post
Quote:
Originally Posted by Relaxing View Post
Worng, Incorrect
Quite Relaxing Answer.

Last edited by Alber9091; 11-11-2017 at 14:10.
Alber9091 is offline
Old.School
Senior Member
Join Date: Sep 2015
Location: France
Old 11-12-2017 , 16:43   Re: [REQ] Detect no kill and punish ( Players which is not killing the enemies)
Reply With Quote #26

So guys?
__________________
You keep bringing B.R down .. He will rise again and kick Enemies asses !
Old.School is offline
Old.School
Senior Member
Join Date: Sep 2015
Location: France
Old 11-16-2017 , 10:51   Re: [REQ] Detect no kill and punish ( Players which is not killing the enemies)
Reply With Quote #27

bump
__________________
You keep bringing B.R down .. He will rise again and kick Enemies asses !
Old.School is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-05-2018 , 23:23   Re: [REQ] Detect no kill and punish ( Players which is not killing the enemies)
Reply With Quote #28

I agree with tarsisd2 on this.

Suppose the T plants at bomb site B and he is looking around to see where the CT may be coming from. If the CT is approaching bombsite B from the bomb site A hill, the T would see him but run away hoping the bomb will explode before the CT has a chance to defuse or looking for a hiding spot to begin shooting when he gets closer. IMO it is fair that he does not choose to exchange fire with the CT(s) in this scenario. This is basically what tarsisd2 is saying, I think.

Perhaps this can be done with implementing a distance threshold. So if T and CT are within X units of each other, are in each others view cone and do not exchange fire, then they are friends and should both be slayed.

AND/OR

Only punish if the bomb has not been planted. If the bomb is planted then the round end is in sight and who cares if they are no killing. This option obviously will only work with de_ maps.

I still don't think this can be done reliably though. There can be times where enemies are in each others view-cone but they do not exchange fire due to other circumstances (other enemies approaching, location in map, sniping). To not make players hate your server you need to be sure they are doing this. You would need to have rules where the players are close to one another, looked at each other multiple times and did not exchange gun fire, etc. I do not run a server so I'm not familiar with players doing this. Is there consistent behavior you see that can more accurately detect this by a plugin?

and yes I know this thread is over a month old but I have been in limbo without a PC for months and am catching up with PM's. I built a new custom water loop PC after the motherboard on my existing build died. Here's the build if you'd like to see.
__________________

Last edited by Bugsy; 01-05-2018 at 23:51.
Bugsy is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 01-06-2018 , 06:36   Re: [REQ] Detect no kill and punish ( Players which is not killing the enemies)
Reply With Quote #29

Quote:
Originally Posted by Bugsy View Post
I agree with tarsisd2 on this.

Suppose the T plants at bomb site B and he is looking around to see where the CT may be coming from. If the CT is approaching bombsite B from the bomb site A hill, the T would see him but run away hoping the bomb will explode before the CT has a chance to defuse or looking for a hiding spot to begin shooting when he gets closer. IMO it is fair that he does not choose to exchange fire with the CT(s) in this scenario. This is basically what tarsisd2 is saying, I think.

Perhaps this can be done with implementing a distance threshold. So if T and CT are within X units of each other, are in each others view cone and do not exchange fire, then they are friends and should both be slayed.

AND/OR

Only punish if the bomb has not been planted. If the bomb is planted then the round end is in sight and who cares if they are no killing. This option obviously will only work with de_ maps.

I still don't think this can be done reliably though. There can be times where enemies are in each others view-cone but they do not exchange fire due to other circumstances (other enemies approaching, location in map, sniping). To not make players hate your server you need to be sure they are doing this. You would need to have rules where the players are close to one another, looked at each other multiple times and did not exchange gun fire, etc. I do not run a server so I'm not familiar with players doing this. Is there consistent behavior you see that can more accurately detect this by a plugin?

and yes I know this thread is over a month old but I have been in limbo without a PC for months and am catching up with PM's. I built a new custom water loop PC after the motherboard on my existing build died. Here's the build if you'd like to see.
You're totally wrong, also tarsisd2.
Read carefully, if you don't understand, read it once again.

This plugin is quite complicated TBH.
Here I go.
A line that connects with the POV(eyes) of a T with the POV of CT. This imaginary line will be only created when these "eyes" can see each other. In a simple conclusion, the line can't pass on Solid stuff, such as walls and doors, and other stuff. The line must go through on BREAKABLE glass.

Next, as soon as this IMAGINARY line is created, the task will be timed to EXPLOSE in a short period of time. 10s <= time <= 20s

This task will kill the player.
As SOON as the line doesn't go valid, the task WILL BE removed. In equality to enemies eyes cannot reach together.

This is a good request, I suggest you to take over it.

Complicated?
(an example of a 32/32 server, equal spereated players to teams)
Actually, the line must connect to all the enemies (max 16 IMAGINARY lines)
In a server, full of players, the amount of lines that will be creates are
16 players * 16 opponents = 256 lines * 2 teams = 512 lines.
These lines must execute functions as soon as their statement turns true. 512 lines * 2 statements = 1024 checks per a single frame.
~30 frames per sec. * 1024 = 30,720 in a second.

Wanna ease it: Don't create the line to players that have been AFKing since their last spawn. Kill 'em.
__________________

Last edited by Relaxing; 01-06-2018 at 09:17. Reason: I just made it more complicated
Relaxing is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-06-2018 , 14:35   Re: [REQ] Detect no kill and punish ( Players which is not killing the enemies)
Reply With Quote #30

Not sure if I understand correctly but here's how this version works.

Player 2 is in Player 1's viewcone; the viewcone check does not take into consideration any obstructions so tracelining will begin if the viewcone condition is met. Traceline is drawn between players to check for any obstructions. If a clear line can be drawn, the time at which a clear line was first drawn is stored. If at any time this line is broken (object in the way or either player looks away) the time is cleared. After cvar [nkp_sightthresholdseconds] seconds of uninterrupted eye contact (not direct, just have to be able to see each other), both are slayed. If multiple players can make eye contact with an enemy, only the first of many is slayed. First meaning highest amount of eye contact time OR if eye contact time is equal, lowest player index value.

The code is currently set in testing mode so you can see the logic in action. To do this, put yourself on terrorist team and put 1+ bots on the CT team. Approach a CT player so you can make eye contact, distance does not matter, and you will see messaging print on the screen. If you look away or make something block view, messaging will display. Remain in eye contact with a CT for 10 seconds and you will both be slayed. To remove the testing messages and make bots excluded from the CT player checking, comment out the [#define TESTING] line.

PHP Code:

#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fakemeta>

new const Version[] = "0.1";

#define TESTING

#define MAX_PLAYERS 32

new g_ThinkingEntity;
new 
g_LastEyeContactMAX_PLAYERS ][ MAX_PLAYERS ];
new 
g_MaxPlayers;
new 
g_pSightThreshold;

public 
plugin_init() 
{
    
register_plugin"No-Kill Punishment" Version "bugsy" );
    
    
register_event"DeathMsg" "EventDeathMsg" "a" );
    
    
g_pSightThreshold register_cvar"nkp_sightthresholdseconds" "10" );
    
g_MaxPlayers get_maxplayers();
    
    
CreateEntity();
}

public 
client_disconnectid )
{
    
ResetPlayerid );
}

public 
EventDeathMsg()
{
    new 
iVictim read_data);
    
    
ResetPlayeriVictim );
}

public 
ViewEntity_ThinkiEntity )
{
    new 
iT32 ] , iCT32 ] , iTNum iCTNum Float:fTOrigin] , Float:fCTOrigin] , iTPlayer iCTPlayer szTName32 ] , szCTName32 ];
    new 
iThresholdSeconds iSysTime;
    
    
get_playersiT iTNum "ace" "TERRORIST" );
    
    
#if defined TESTING
    
get_playersiCT iCTNum "ae" "CT" );
    
#else
    
get_playersiCT iCTNum "ace" "CT" );
    
#endif
    
    
if ( iTNum && iCTNum )
    {
        for ( new 
iTNum i++ )
        {
            
iTPlayer iT];
            
            for ( new 
iCTNum p++ )
            {
                
iCTPlayer iCT];
                
                
entity_get_vectoriCTPlayer EV_VEC_origin fCTOrigin );
                
                if ( 
is_in_viewconeiTPlayer fCTOrigin ) )
                {
                    
entity_get_vectoriTPlayer EV_VEC_origin fTOrigin );
                    
                    if ( 
IsInLineOfSightfTOrigin fCTOrigin ) )
                    {
                        if ( !
g_LastEyeContactiTPlayer ][ iCTPlayer ] )
                        {
                            
g_LastEyeContactiTPlayer ][ iCTPlayer ] = get_systime();
                        }
                        
#if defined TESTING
                        
else
                        {
                            
get_user_nameiTPlayer szTName charsmaxszTName ) );
                            
get_user_nameiCTPlayer szCTName charsmaxszCTName ) );
                            
client_printiTPlayer print_chat "%s AND %s CAN SEE EACH OTHER - %d SECONDS" szTName szCTName  , ( get_systime() - g_LastEyeContactiTPlayer ][ iCTPlayer ] ) );
                        }
                        
#endif
                    
}
                    
#if defined TESTING
                    
else
                    {
                        if ( 
g_LastEyeContactiTPlayer ][ iCTPlayer ] )
                        {
                            
get_user_nameiTPlayer szTName charsmaxszTName ) );
                            
get_user_nameiCTPlayer szCTName charsmaxszCTName ) );
                            
client_printiTPlayer print_chat "LINE OF SIGHT BROKEN FOR %s AND %s" szTName szCTName );
                            
g_LastEyeContactiTPlayer ][ iCTPlayer ] = 0;
                        }
                    }
                    
#endif
                
}
                else
                {
                    
#if defined TESTING
                    
if ( g_LastEyeContactiTPlayer ][ iCTPlayer ] )
                    {
                        
get_user_nameiTPlayer szTName charsmaxszTName ) );
                        
get_user_nameiCTPlayer szCTName charsmaxszCTName ) );
                        
client_printiTPlayer print_chat "LINE OF SIGHT BROKEN FOR %s AND %s" szTName szCTName );
                    }
                    
#endif
                    
                    
g_LastEyeContactiTPlayer ][ iCTPlayer ] = 0;
                }
            }
        }
        
        
iSysTime get_systime();
        
iThresholdSeconds get_pcvar_numg_pSightThreshold );
        
        for ( new 
iT iT <= g_MaxPlayers iT++ )
        {
            for ( new 
iCT iCT <= g_MaxPlayers iCT++ )
            {
                if ( 
g_LastEyeContactiT ][ iCT ] && ( ( iSysTime g_LastEyeContactiT ][ iCT ] ) >= iThresholdSeconds ) )
                {
                    
get_user_nameiT szTName charsmaxszTName ) );
                    
get_user_nameiCT szCTName charsmaxszCTName ) );
                        
                    
client_printprint_chat "* Killing %s and %s for No-Killing!" szTName szCTName );
                    
                    
user_killiT );
                    
user_killiCT );
                    
                    
g_LastEyeContactiT ][ iCT ] = 0;
                }
            }
        }
    }
    
    
entity_set_floatg_ThinkingEntity EV_FL_nextthink get_gametime() + 0.1 );
}


bool:IsInLineOfSightFloat:fOrigin1] , Float:fOrigin2] )
{
    new 
iTrace Float:fFraction;
    
    
engfuncEngFunc_TraceLine fOrigin1 fOrigin2 IGNORE_MONSTERS iTrace );
    
get_tr2iTrace TR_flFraction fFraction );
    
    return 
bool:( fFraction == 1.0 );
}  

ResetPlayerid )
{
    new 
CsTeams:csTeam cs_get_user_teamid );
    
    if ( 
csTeam == CS_TEAM_T )
    {
        
arraysetg_LastEyeContactid ] , sizeofg_LastEyeContact[] ) );
    }
    else if ( 
csTeam == CS_TEAM_CT )
    {
        for ( new 
iT iT <= g_MaxPlayers iT++ )
        {
            
g_LastEyeContactiT ][ id ] = 0;
        }
    }
}

CreateEntity()
{
    
g_ThinkingEntity create_entity"info_target" );
    
entity_set_stringg_ThinkingEntity EV_SZ_classname "view_entity" );
    
register_think"view_entity" "ViewEntity_Think" );
    
    
entity_set_floatg_ThinkingEntity EV_FL_nextthink get_gametime() + 0.1 );

__________________

Last edited by Bugsy; 01-06-2018 at 15:39.
Bugsy 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 21:31.


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