Forum

> > CS2D > Scripts > Anti flash
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Anti flash

7 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Anti flash

BestMan
User Off Offline

Zitieren
Hi. I creating new script, and i can't create anti flash system for class "Flasher". Somebody can help me?

alt Re: Anti flash

JOJ
User Off Offline

Zitieren
Well do not even know can help CrazyBooy think so but it is unlikely he will be online

alt Re: Anti flash

Alistaire
User Off Offline

Zitieren
You can't make a flashbang not flash persons. You could check for people in range of the flashbang and flash them seperately with flashplayer, and leave the people with the Flasher class, or only leave the thrower of the flashbang.

EDIT: There's an easier way:
1
2
3
4
5
6
7
8
9
addhook('projectile', 'projectileHook')

function projectileHook(id, wpn)
	if wpn == 52 then
		local ox, oy = player(id, 'x'), player(id, 'y')
		parse('setpos '..id..' 0 0')
		timer(0, 'parse', 'setpos '..id..' '..ox..' '..oy)
	end
end

This teleports the player away from his flashbang for one frame, which renders him safe for the millisecond it takes for the grenade to explode after projectileHook is called.

The timer(0, ...) is crucial in this script; it takes a tiny amount of time for Lua to call this function. I don't know how good/bad this will work on laggy servers, but from what I've tested it seems the player WILL be flashed for a brief second, until the server catches up with the wrongly flashed player.

alt Re: Anti flash

Alistaire
User Off Offline

Zitieren
user ohaz hat geschrieben
Add a if query that checks if the "id" has the class Flasher @user BestMan:


I assumed only flashers had access to flash grenades. If this isn't the case you should know what to do.

alt Re: Anti flash

VADemon
User Off Offline

Zitieren
@user Alistaire does the flash really go away after the player is ported back? I've made an antiflash by removing the flashbang as a projectile, but I had to remove the flashbang ~150ms before, because else the change would hit clients AFTER flashbangs explosion > the player is blind though.

alt Re: Anti flash

Alistaire
User Off Offline

Zitieren
user VADemon hat geschrieben
@user Alistaire does the flash really go away after the player is ported back? I've made an antiflash by removing the flashbang as a projectile, but I had to remove the flashbang ~150ms before, because else the change would hit clients AFTER flashbangs explosion > the player is blind though.


Test it for yourself, it works.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht