Raised This Month: $ Target: $400
 0% 

Kill while flashbanged


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-25-2017 , 02:29   Kill while flashbanged
Reply With Quote #1

I'm trying to check if a player has killed someone while flashbanged.

Thats the best way to do this?

PHP Code:
public msgScreenFade(iMessageIDiMessageDestinityiEntity)
{    
    const 
MIN_AMMOUNT 100
    
    
if(get_msg_arg_int(4) >= MIN_AMMOUNT 
    
&& get_msg_arg_int(5) >= MIN_AMMOUNT 
    
&& get_msg_arg_int(6) >= MIN_AMMOUNT 
    
&& get_msg_arg_int(7) > 0xC7// I also don't know what it means, someone explain?
    
{
        
PlayerData[iEntity][arPlayerBlinded] = true
        
        
if(task_exists(iEntity+TASK_NOTBLIND))
            
remove_task(iEntity+TASK_NOTBLIND)
            
        
set_task(5.0,"userIsNotBlindAnymore",iEntity+TASK_NOTBLIND)
    }
}

public 
userIsNotBlindAnymore(playerID)
{
    new 
id playerID TASK_NOTBLIND
    
    PlayerData
[id][arPlayerBlinded] = false

And

PHP Code:
public DeathMsg()
{
    new 
iKiller read_data(1)

    if(
PlayerData[iKiller][arPlayerBlinded)
    {
        
// bla bla bla
    
}

__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

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

Last edited by EFFx; 01-25-2017 at 02:30.
EFFx is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 01-25-2017 , 04:11   Re: Kill while flashbanged
Reply With Quote #2

You can calculate set_task time from duration and holdtime parameters.
Also you can check blind directly via private data, code from gamedll:
PHP Code:
float endTime pPlayer->m_blindFadeTime pPlayer->m_blindHoldTime pPlayer->m_blindStartTime;

if (
gpGlobals->time endTime)
{
  
// Player is blind, but he can be not fully blind 
I'm not sure, but I think that m_blindUntilTime should check full blind:
PHP Code:
if (gpGlobals->time pPlayer->m_blindUntilTime)
{
  
// Player is fully blind 
__________________

Last edited by PRoSToTeM@; 01-25-2017 at 04:26.
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-25-2017 , 19:25   Re: Kill while flashbanged
Reply With Quote #3

Yea, I thinked about calculate the time of set_task with parameters, but I don't know, I've used a debug for these parameters, thats what I got:

Code:
get_msg_arg_int(1), get_msg_arg_int(2), get_msg_arg_int(3)
(1): 40496, (2): 8999, (3): 0 - Ahead
(1): 20989, (2): 3426, (3): 0 - Behind
And another thing, I want not make another thread about this.

I'm trying to pick the defuse time, like CSGO messages - "EFFx has defused the bomb with 0.3 seconds remaining"

Thats what I have:
PHP Code:
new Float:fC4TimeFloat:fC4DefuseFloat:fTimeResult

public bomb_planted(id)
{
   
fC4Time get_gametime()
}
public 
bomb_defused(id)
{
   
fC4Defuse get_gametime()

   
fTimeResult fC4Defuse fC4Time
   console_print
(id,"Defuse Time: %0.1f",fTimeResult)

input:

Code:
Defuse Time: 41.1 - mp_c4time is 45
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

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

Last edited by EFFx; 01-25-2017 at 19:26.
EFFx is offline
SpannerSpammer
Member
Join Date: Mar 2006
Old 01-26-2017 , 02:04   Re: Kill while flashbanged
Reply With Quote #4

ScreenFade user message and flags:
Code:
// (HL) Screen Fade type flags
#define FFADE_IN			0x0000		// Just here so we don't pass 0 into the function
#define FFADE_OUT			0x0001		// Fade out (not in)
#define FFADE_MODULATE		0x0002		// Modulate (don't blend)
#define FFADE_STAYOUT		0x0004		// ignores the duration, stays faded out until new ScreenFade message received

message_begin( MSG_ONE, gmsgFade, _, id ); 	// use the magic #1 for "one client"
write_short( duration );			// fade lasts this long
write_short( holdtime );			// fade lasts this long
write_short( fadeflags );			// fade type (in / out)
write_byte( r );				// fade red
write_byte( g );				// fade green
write_byte( b );				// fade blue
write_byte( a );				// fade alpha / brightness
message_end();
Duration and holdtime parameters are scaled by 4096 and
sent as an unsigned short interger (0 - 65535). Reverse that
process to get the original values for your plugin. Well, sort of,
the values sent might have been truncated in the conversion
(float->int) or clamped to an unsigned short interger range.

Note: If FFADE_STAYOUT flag is set then the player stays blinded
until another screenfade msg is sent and overrides the current one.
This is not applicable to flashbang grenades though.
__________________
[NeoTF|DEV]SpannerSpammer-[AoE]-
NeoTF Development Team.
http://steamcommunity.com/groups/neotf
SpannerSpammer is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 01-26-2017 , 17:50   Re: Kill while flashbanged
Reply With Quote #5

PHP Code:
if (get_gametime() < get_ent_data_float(iKiller"CBasePlayer""m_blindUntilTime"))
{
  
// Player is fully blind 
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-26-2017 , 17:54   Re: Kill while flashbanged
Reply With Quote #6

i'm not checking if the player is fully blind. I don't updated the code, but on the (7) parameter, i'm checking if the value is more than 200, that value is the only I got when the flash explodes behind me, from my side or the front.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

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

Last edited by EFFx; 01-26-2017 at 17:59.
EFFx is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 01-26-2017 , 21:50   Re: Kill while flashbanged
Reply With Quote #7

Try to check it in work.
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-26-2017 , 22:15   Re: Kill while flashbanged
Reply With Quote #8

Dude, what include have this get_ent_data_float()? I got error with that native.

And can someone explain me about the defuse remaining time?
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

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

Last edited by EFFx; 01-27-2017 at 04:35.
EFFx is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 01-27-2017 , 07:51   Re: Kill while flashbanged
Reply With Quote #9

Quote:
Originally Posted by EFFx View Post
Dude, what include have this get_ent_data_float()? I got error with that native.
That's a native that's only available in 1.8-3-dev, since #284. It's in fakemeta. It's a much better version of pdata natives.

Last edited by klippy; 01-27-2017 at 07:52.
klippy is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-27-2017 , 16:05   Re: Kill while flashbanged
Reply With Quote #10

But if have someone thats not using 1.8.3 like me? Will that format works?
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx 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 15:44.


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