livre2_pressed = 0 booknum = 0 function book_init(e) LoadImages("book",0) end function book_main(e) PlayerDist = GetPlayerDistance(e) if PlayerDist < 50 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("E to read.") if g_KeyPressE == 1 then SetActivated(e,1) end else Prompt("...") end end else if g_Entity[e]['activated'] == 1 then Prompt("E to read.") 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(booknum) PlaySound(e,0) FreezePlayer(0) booknum = booknum + 1 StartTimer(e) livre2_pressed = 1 end else if g_Entity[e]['activated'] == 2 then -- Timer... (ex : 8000 = 8 seconds) if GetTimer(e)>18000 then --HideImage(0) Prompt("You can't read that again.") 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