I throw flashbang, it show me who's blind(script works fine)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
addhook("projectile","flash_projectile")
function flash_projectile(id,weapon,x,y,projectileid)
if weapon ~= 52 then return end
local blinded_ids = {}
local not_blinded_ids = {}
local screen_w = 850 / 2
local screen_h = 480 / 2
for _,pid in pairs(player(0,"tableliving")) do
if pid ~= id then
local px = player(pid,"x")
local py = player(pid,"y")
if math.abs(px - x) <= screen_w and math.abs(py - y) <= screen_h then
local raycheck = raycast(x,y,px,py)
				if raycheck == true then
table.insert(blinded_ids, player(pid,"name"))
else
table.insert(not_blinded_ids, player(pid,"name"))
end
end
end
end
if #blinded_ids > 0 then
msg("Blinded: "..table.concat(blinded_ids,", "))
end
if #not_blinded_ids > 0 then
msg("On screen, but not blinded: "..table.concat(not_blinded_ids,", "))
end
end
function raycast(x1, y1, x2, y2)
local dx = x2 - x1
local dy = y2 - y1
local dist = math.sqrt(dx*dx + dy*dy)
local steps = math.floor(dist / 16)
if steps < 1 then steps = 1 end
local stepx = dx / steps
local stepy = dy / steps
local cx, cy = x1, y1
for i = 1, steps do
cx = cx + stepx
cy = cy + stepy
local tx = math.floor(cx / 32)
local ty = math.floor(cy / 32)
if tile(tx, ty, "wall") then
return false
end
end
return true
end
i stuck with image mode. Can i create sprite as a hud but always rendering map position while being flashed? what image mode i can use for that? Don't forget it must be not refreshed by script. And also there is a way create such image over flash screen effect? The main idea is like having this "eye" sprite while somebody is flashed(Spectator mode).
"Blindfucker Hero":
lvl 1 - Eye sense) Throw 10 flashbangs in total. Unlocks: Blinded player info msg.
lvl 2 - Blindmaster) Throw 500 flashbangs in total. Unlocks: On screen, but not blinded players info.
lvl 3 - Blindfucker) Throw 1000 flashbangs in total. Unlocks: hud image added on screen "gfx/Mora/Blindfucker/eye.png" centre to see urself when flashed.
lvl 4 - Blindfucker-I) Flash 100 players in total. Unlocks: Show all players last pos on ur screen when flashed by own flashbang
lvl 5 - Blindfucker-II) Flash 500 players in total. Unlocks: Show all players last pos on ur screen when flashed by others flashbang
lvl 6 - Blindfucker-Master sense I) Throw 1500 flashbangs in total. Unlocks: Update blinded players pos after 500 ms when flashed by self grenade
lvl 7 - Blindfucker-Master sense II) Flash 1000 players in total. Unlocks: Updated blined players pos after 500 ms when flashed by others grenade.
etc.... As you may see is required to work with hud images being flashed, mode 2 doesn't fit requirements.
This must be the good new one image mode that created this way without calculating it via scripts
maybe image mode 5? (HUD image (covering everything, part of the interface, affected by mp_hudscale and uses map x/y coordinates) edited 1×, last 16.02.26 07:58:15 am
Hud image on map issue
1 
Offline

Gaios