livre2_pressed = 0 function book_init(e) LoadImages("book",0) end function book_main(e) PlayerDist = GetPlayerDistance(e) if PlayerDist < 250 then if g_Entity[e]['activated'] == 0 then if g_Entity[e]['haskey'] == -1 then SetActivated(e,1) else if g_Entity[e]['haskey'] == 1 then Prompt("Press E to read the book") if g_KeyPressE == 1 then SetActivated(e,1) end else Prompt("...") end end else if g_Entity[e]['activated'] == 1 then Prompt("Press E to read the book") if g_KeyPressE == 1 and g_Entity[e]['animating'] == 0 and livre2_pressed == 0 then g_Entity[e]['animating'] = 1 SetActivated(e,2) ActivateIfUsed(e) SetImagePosition(50,50) ShowImage(0) PlaySound(e,0) StartTimer(e) livre2_pressed = 1 end else if g_Entity[e]['activated'] == 2 then -- Timer... (ex : 8000 = 8 seconds) if GetTimer(e)>8000 then --HideImage(0) Prompt("This book has already been read...") HideImage(0) end if g_KeyPressE == 1 and g_Entity[e]['animating'] == 0 and livre2_pressed == 0 then g_Entity[e]['animating'] = 1 SetActivated(e,1) livre2_pressed = 1 end end end end end if g_KeyPressE == 0 then livre2_pressed = 0 end end