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

How to detect a kill inside smoke?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 06-23-2022 , 16:52   How to detect a kill inside smoke?
Reply With Quote #1

How to detect a player kill inside smoke?

Thanks
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 06-23-2022 , 18:02   Re: How to detect a kill inside smoke?
Reply With Quote #2

You can check this:
https://github.com/s1lentq/ReGameDLL....cpp#L306-L336
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 06-24-2022 , 09:58   Re: How to detect a kill inside smoke?
Reply With Quote #3

This is in serverFrame loop, is not bad. But it detect player inside smoke.

I need in really to know when player was killed behind the smoke, and killer is not seeing it.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 06-24-2022 , 10:47   Re: How to detect a kill inside smoke?
Reply With Quote #4

Quote:
Originally Posted by ^SmileY View Post
How to detect a player kill inside smoke?

Thanks
you specified inside smoke

Quote:
Originally Posted by ^SmileY View Post
This is in serverFrame loop, is not bad. But it detect player inside smoke.

I need in really to know when player was killed behind the smoke, and killer is not seeing it.
You can check if the entity is visible in the view cone and if it was inside the smoke or the other side of the smoke by getting detonation position of the smoke and moving the X cord outside the smoke.
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]

Last edited by Shadows Adi; 06-24-2022 at 10:50.
Shadows Adi is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 06-24-2022 , 12:40   Re: How to detect a kill inside smoke?
Reply With Quote #5

I will study this, thanks for help.

Ps. I typed inside wrong sorry
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 06-25-2022 , 01:02   Re: How to detect a kill inside smoke?
Reply With Quote #6

Following shadow's advice will definitely help. I have a hacky way to detect players inside the smoke to block the "enemy: X" hud message. Basically I did what he said:

Check smokes around you. Get it's origin point. Check if you are closer enough (guess the radius is 115.0, you can make it up to 150-180 maybe), which will define whether you are inside of the smoke. This will be the first solution to detect kills inside the smoke (maybe both players inside the smoke, or even killing players in the distance, while YOU are inside the smoke).

You can use the same way to detect whether the victim is inside the smoke, so even if you are not inside the smoke, but the victim is, there's another solution to detect a kill through smoke as well.
-
Last solution we'll need to find out is to how to detect a kill when both players are far away from the smoke, but the aim was through the smoke still.
Maybe making a traceline each 10-15 units, checking if there's any smoke around the origin of the trace?
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 06-25-2022 at 01:38.
EFFx is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 06-25-2022 , 09:40   Re: How to detect a kill inside smoke?
Reply With Quote #7

Quote:
Originally Posted by EFFx View Post
Following shadow's advice will definitely help. I have a hacky way to detect players inside the smoke to block the "enemy: X" hud message. Basically I did what he said:

Check smokes around you. Get it's origin point. Check if you are closer enough (guess the radius is 115.0, you can make it up to 150-180 maybe), which will define whether you are inside of the smoke. This will be the first solution to detect kills inside the smoke (maybe both players inside the smoke, or even killing players in the distance, while YOU are inside the smoke).

You can use the same way to detect whether the victim is inside the smoke, so even if you are not inside the smoke, but the victim is, there's another solution to detect a kill through smoke as well.
-
Last solution we'll need to find out is to how to detect a kill when both players are far away from the smoke, but the aim was through the smoke still.
Maybe making a traceline each 10-15 units, checking if there's any smoke around the origin of the trace?
Yes, to be honest im making a plugin that count stats of game: https://github.com/SmileYzn/StatsX

And in this plugin is lacking to detect smoke frags.
For me do not matter where killer <-> target is, but a way to detect basically frags while killer is not seeing the victim. And smoke is some of this stats:

PHP Code:
/**
* Hack Stats Group
*/
enum HackStatsGroup
{
    
HACK_WALL_FRAG        0// OK Counting
    
HACK_BLIND_FRAG        1// OK Counting
    
HACK_SMOKE_FRAG     2// To do
    
HACK_ONE_SHOT       3// OK Counting
    
HACK_NO_SCOPE        4// OK Counting
}; 
I Will check if traceline can detect smokes. And post results here.
Thanks for help

I reach this, traceline not worked, but this method yes

PHP Code:
// Result 0: No players
// Result 1: Attacker is inside smoke
// Result 2: Victim is inside smoke
// Result 3: Both are inside smoke
int CStats::IsSmokeInside(CBasePlayerPlayerCBasePlayerTarget)
{
    
edict_tpentFind nullptr;

    
int Result 0;

    while ((
pentFind FIND_ENTITY_BY_CLASSNAME(pentFind"grenade")))
    {
        if (!
FNullEnt(pentFind))
        {
            
CBaseEntitypEnt CBaseEntity::Instance(pentFind);

            if (
pEnt)
            {
                
// If smoke is not Light Smoke yet ??
                //if (gpGlobals->time < pEnt->pev->dmgtime)
                
{
                    const 
Vector smokeOrigin pEnt->pev->origin;

                    if ((
smokeOrigin Player->edict()->v.origin).IsLengthLessThan(115.0f)) // 115.0f (For smoke)
                    
{
                        
gUtil.ServerPrint("[%s] Killer Is inside smoke!"STRING(Player->edict()->v.netname));

                        
Result += 1;
                    }

                    if ((
smokeOrigin Target->edict()->v.origin).IsLengthLessThan(115.0f)) // 115.0f (For smoke)
                    
{
                        
gUtil.ServerPrint("[%s] Victim Is inside smoke!"STRING(Target->edict()->v.netname));

                        
Result += 2;
                    }
                }
            }
        }
        else
        {
            break;
        }
    }

    return 
Result;

__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 06-25-2022 at 11:17.
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-25-2022 , 16:53   Re: How to detect a kill inside smoke?
Reply With Quote #8

if (pEnt)

Instead of checking if entity is positive, check if its a smoke grenade.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 06-27-2022 , 12:02   Re: How to detect a kill inside smoke?
Reply With Quote #9

PHP Code:
// Result 0: No players
// Result 1: Attacker is inside smoke
// Result 2: Victim is inside smoke
// Result 3: Both are inside smoke
int CStats::InsideSmoke(CBasePlayerPlayerCBasePlayerTargetfloat Distance// 115.0f
{
    
int Result 0;

    if (
g_ReGameFuncs)
    {
        
CGrenadepEntity nullptr;

        while ((
pEntity = (CGrenade*)g_ReGameFuncs->UTIL_FindEntityByString((CBaseEntity*)pEntity"classname""grenade")))
        {
            if (
pEntity->m_bDetonated)
            {
                if (
pEntity->m_SGSmoke 0)
                {
                    if ((
pEntity->m_vSmokeDetonate Player->edict()->v.origin).IsLengthLessThan(Distance))
                    {
                        
Result += 1;
                    }

                    if ((
pEntity->m_vSmokeDetonate Target->edict()->v.origin).IsLengthLessThan(Distance))
                    {
                        
Result += 2;
                    }

                    if (
Result)
                    {
                        return 
Result;
                    }
                }
            }
        }
    }

    return 
Result;

Final code for detect inside, still need a check to behind smoke frags
Thanks for help.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 06-28-2022 , 23:07   Re: How to detect a kill inside smoke?
Reply With Quote #10

Final Solution: Check if killer can see the victim using SBarState (m_izSBarState)

This check where player is aiming:

PHP Code:
if (Killer->m_izSBarState[SBAR_ID_TARGETTYPE] == 0)
{
    if (!
Killer->IsObserver())
    {
        
// Player Killed without see the target
                // Detect if is killer is blind, has a wall behind killer and victim and SMOKE visibility.
    
}

Ps. I'm using ReGameDLL_CS, soo:

player.cpp#L7768
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 06-28-2022 at 23:11.
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
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 08:27.


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