[help]how to use pc.is_dead()

08/24/2011 16:40 cpsky#1
who can tell me how to active the code: pc.is_dead.
i made quest like this ,but don't work.
Code:
quest dead begin
    state start begin
		when kill begin
			if pc.is_dead() then
				chat("you dead!")
			end
        end
    end
end
08/24/2011 17:13 [TM]SixSense#2
Quote:
when kill begin
kill what? :)

Quote:
when pc.get_hp() < 1 begin
game.drop_item(50076, 1)
end
;)
08/24/2011 17:27 [SGA]Jango#3
sicher das dat funzt ->
Code:
when pc.get_hp() < 1 begin
machs mit ner timer schleife dann funzt das!
08/24/2011 17:28 cpsky#4
when pc.get_hp() < 1 begin
game.drop_item(50076, 1)
end

can it working?
08/24/2011 17:31 [SGA]Jango#5
no! maybe on 2011 or so!
but on 2007 im testing it and it dosent worke
08/24/2011 17:41 cpsky#6
is this code pc.is_dead() need run with timer to actve only?
i made this ,and it works.
Code:
quest siwang begin
    state start begin
	
		when login  begin
			timer('siwang1', 10)
		end
		
		when siwang1.timer begin 
				if pc.is_dead() == true then
					if pc.get_empire() == 1 then
						pc.warp(409600, 896000 )
					elseif pc.get_empire() == 2 then
						pc.warp(0, 102400 )
					else
						pc.warp(921600, 204800 )
					end
				end
			timer('siwang2', 10) 
		end 		

		when siwang2.timer begin 
				if pc.is_dead() == true then
					if pc.get_empire() == 1 then
						pc.warp(409600, 896000 )
					elseif pc.get_empire() == 2 then
						pc.warp(0, 102400 )
					else
						pc.warp(921600, 204800 )
					end
				end
			timer('siwang1', 10) 
			end
		
	end
end