livre2_pressed = 0 function livre1_init(e) LoadImages("livre1",0) end function livre1_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 red 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 red 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) FreezePlayer(0) StartTimer(e) livre2_pressed = 1 end else if g_Entity[e]['activated'] == 2 then -- Temps de lecture selon le sons... (ex : 8000 = 8 secondes) if GetTimer(e)>8000 then --HideImage(0) Prompt("This book has been read...") HideImage(0) UnFreezePlayer(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