Forum

> > CS2D > Scripts > No accessing menu, serveraction If player dead?
Forums overviewCS2D overview Scripts overviewLog in to reply

English No accessing menu, serveraction If player dead?

4 replies
To the start Previous 1 Next To the start

old No accessing menu, serveraction If player dead?

KenVo
User Off Offline

Quote
The title says everything. How to prevent players from accessing menu, serveraction when the person is dead ? I know how if players are spectator but I can't when players are dead...even though i use "if player(id, 'health') < 0"
1
2
3
4
5
6
7
8
9
10
11
12
addhook("serveraction","Xserveraction")
function Xserveraction(id,action)
	if player(id, 'team') == 0 then return end
	if player(id, 'health') < 0 then return end
........................--This not not the whole script

addhook("menu","Xmenu")
function Xmenu(id, title, button)
	if player(id, 'health') < 0 then return end
	if player(id, 'team') == 0 then return end
	if button == 0 then return end
........................--This not not the whole script

Please help me

old Re: No accessing menu, serveraction If player dead?

J4x
User Off Offline

Quote
why
1
if player(id, 'health') < 0
it should be
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("serveraction","Xserveraction")
function Xserveraction(id,action)
	if player(id,"health") == 0 then 
return 
	end
end

addhook("menu","Xmenu")
function Xmenu(id, title, button)
     if player(id, 'health') == 0 then 
	return 
end
     if button == 0 then 
	return 
end
something like that i think, im learning lua so dont expect to much from me.

old Re: No accessing menu, serveraction If player dead?

robed
User Off Offline

Quote
why you could just use this


addhook("dead","Xmenu")
function Xmenu(id, title, button)
1
2
addhook("dead","Xmenu")
function Xmenu(id, title, button)

that one is easier


EDT:ahh ididnt understand i thought when ur dead show menu
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview