Raised This Month: $32 Target: $400
 8% 

Anti No-Flash


Post New Thread Reply   
 
Thread Tools Display Modes
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 03-08-2010 , 11:33   Re: Anti No-Flash
Reply With Quote #11

Quote:
Originally Posted by ConnorMcLeod View Post
You should float read_data value
I don't see a reason for that. Maybe it would bring a bit of readability but it's just a style issue.
SnoW is offline
Send a message via MSN to SnoW
Rul4
Senior Member
Join Date: Sep 2008
Location: Argentina
Old 03-08-2010 , 12:20   Re: Anti No-Flash
Reply With Quote #12

Quote:
Originally Posted by ConnorMcLeod View Post
g_flashed_until[id] = read_data(2)/4096.0 + get_gametime();

You should float read_data value

Also i think you could use instead : g_flashed_until[id] = get_pdata_float(id, 514, 5)

Just make some comparison of bith values


Those following offsets were founded by VEN, and arkshine recently confirm, after having decompiled the .dll that it seems to be right.

Code:
514 - fGametime flashed until ?
515 - fGametime flashed at ?
516 - fHoldTimeInSeconds of ScreenFade
517 - fDurationInSeconds of ScreenFade
518 - iAlpha of ScreenFade
That could be another way of doing it. But I can think of 2 reasons not to:
a) It already works, why changing it?
b) Other plugins send the ScreenFade msg. I am not sure how they will interact with those offsets. I am sure hooking the ScreenFade msg will keep working.

Quote:
Originally Posted by ConnorMcLeod View Post
Last, you should cache maximum of things that are checked in addtofulpack such as bot, alive, plugin on/off so you can save some native calls.
I agree. That could add the potential problem of caching something that changes (e.g.: I am not sure if ent IDs are kept when the map changes) but it is worth a try.
__________________
Check out my other plugins.
Rul4 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-08-2010 , 12:44   Re: Anti No-Flash
Reply With Quote #13

1. Use the offset when the ScreenFade event is triggered.

2. Cache if an id is a bot at players connection for exemple.
Check first if player == 1 will prevent to check the cvar and such many times,
etc..., just need to think a bit.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
ditmesteam
Senior Member
Join Date: Oct 2009
Old 03-08-2010 , 12:45   Re: Anti No-Flash
Reply With Quote #14

Some peope play in my server often say " why does not he get blinded when I throw flashed bang, he may use cheat"
Now this plugin can prevent no flash cheat
Can you make one option cvar: do not flash team mate if friendly mode is off
ditmesteam is offline
Rul4
Senior Member
Join Date: Sep 2008
Location: Argentina
Old 03-08-2010 , 12:51   Re: Anti No-Flash
Reply With Quote #15

Quote:
Originally Posted by ConnorMcLeod View Post
1. Use the offset when the ScreenFade event is triggered.
Again: why? What is the advantage of using this over getting the HoldTime?
__________________
Check out my other plugins.
Rul4 is offline
Rul4
Senior Member
Join Date: Sep 2008
Location: Argentina
Old 03-08-2010 , 13:04   Re: Anti No-Flash
Reply With Quote #16

I just posted a new version caching the values Connor suggested.

About the no-flash var for teammates: there are other plugins already doing that. The purpose of this one is just anti-cheating.
__________________
Check out my other plugins.
Rul4 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-08-2010 , 13:04   Re: Anti No-Flash
Reply With Quote #17

You get it faster.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 03-08-2010 , 16:52   Re: Anti No-Flash
Reply With Quote #18

Tested with ECC 5.2 and it works. Nice job.
The blind time could be bigger, though, cause the player goes visible as soon as the flash starts to fade out, and normal players can't see in this moment.
Seta00 is offline
lazarev
Veteran Member
Join Date: Sep 2008
Old 03-08-2010 , 17:16   Re: Anti No-Flash
Reply With Quote #19

PHP Code:
if (!get_pcvar_num(pcv_on))
    return 
FMRES_IGNORED;

if (!
g_isAlive[host])
    return 
FMRES_IGNORED;

if (
g_isBot[host])
    return 
FMRES_IGNORED;

if (!
player)
    return 
FMRES_IGNORED


PHP Code:
if( !get_pcvar_num(pcv_on) || !g_isAlive[host] || g_isBot[host] || !player )
    return 
FMRES_IGNORED
lazarev is offline
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 03-08-2010 , 17:22   Re: Anti No-Flash
Reply With Quote #20

Good idea and a nice plugin, well done!

For the caching stuff, here are some things you could improve even further:

- Checking the cvar in every AddToFullPack will add up to thousands of calls every second. I'd suggest to unregister the forward completely if the plugin is disabled and do the required cvar check at the beginning of a round. To overcome the minor inconvenience of not being able to change the plugin state mid-round (which should not be any hassle, who would want to disable a anti-cheat plugin anyway) you could introduce an admin command that hooks the forward again.
- Check the player var before the other two. It should be better to access the non-array stuff first.
- ent != host and g_isAlive[ent] could be placed, like the other 3 checks, before get_gametime. ent != host should go in front of the array stuff aswell.
__________________
In Flames we trust!
Nextra 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 23:30.


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