Advertisement
NanoBob

cinema camera matrix

Jul 23rd, 2015
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.61 KB | None | 0 0
  1. local seated=false
  2.  
  3. function setPlayerSeated()
  4.     for id,screen in pairs(screens) do
  5.         if isElementWithinColShape(getLocalPlayer(),screen.col)==false or getElementDimension(localPlayer) ~= 5 or getElementInterior(localPlayer) ~= 5 then
  6.             local x,y,z=getElementPosition(getLocalPlayer())
  7.             local sx,sy,sz=getElementPosition(screen.screen)
  8.             setCameraMatrix(x,y,z+1,sx,sy,sz)
  9.             seated=true
  10.         end
  11.     end
  12. end
  13. addCommandHandler("sit",setPlayerSeated)
  14.  
  15. function setPlayerStanding()
  16.     if seated==true then
  17.         setCameraTarget(getLocalPlayer())
  18.         seated=false
  19.     end
  20. end
  21. addCommandHandler("stopanim",setPlayerStanding)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement