Advertisement
Guest User

killcamc.lua

a guest
Feb 5th, 2017
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.56 KB | None | 0 0
  1. function movecamera()
  2.   x, y, z = getElementPosition(camobj)
  3.   th, tj, tk = getElementPosition(tarobj)
  4.   setCameraMatrix(x, y, z, th, tj, tk)
  5. end
  6. function shotfunc()
  7.   if alpha <= 255 and alpha > 0 then
  8.     alpha = alpha - 1
  9.     dxDrawText(text, 576, 544, 778, 601, tocolor(255, 200, 0, alpha), 2, "sans", "center", "top", false, false, false)
  10.   end
  11. end
  12. addEventHandler("onClientRender", root, shotfunc)
  13. text = " "
  14. alpha = 0
  15. function goodguy1()
  16.   dxDrawLine3D(th, tj, tk, th + (hx - th - (hx - th + 0.2)), tj + (hy - tj - (hy - tj + 0.2)), tk + (hz - tk - (hz - tk + 0.2)), tocolor(64, 64, 64, 255))
  17. end
  18. function goodguy2()
  19.   dxDrawLine3D(tv, tb, tn, tv + (hx - tv - (hx - tv + 0.2)), tb + (hy - tb - (hy - tb + 0.2)), tn + (hz - tn - (hz - tn + 0.2)), tocolor(64, 64, 64, 255))
  20. end
  21. function movereciever()
  22.   tv, tb, tn = getElementPosition(target)
  23.   h, j, k = getElementPosition(localPlayer)
  24.   setCameraMatrix(h + 5, j + 5, k + 5, tv, tb, tn)
  25. end
  26. function killcam(tz, tx, tc, hjx, hjy, hjz, bodypart, moving, reciever, weapon)
  27.   setGameSpeed(0.05)
  28.   camobj = createObject(327, tz + 2.5, tx + 2.5, tc + 2.5)
  29.   tarobj = createObject(327, tz, tx, tc)
  30.   setElementAlpha(camobj, 0)
  31.   setElementAlpha(tarobj, 0)
  32.   moveObject(camobj, 4000, hjx + 5, hjy + 5, hjz + 5)
  33.   if bodypart == 9 then
  34.     moveObject(tarobj, 5000, hjx, hjy, hjz + 1)
  35.   else
  36.     moveObject(tarobj, 5000, hjx, hjy, hjz)
  37.   end
  38.   hx = hjx
  39.   hy = hjy
  40.   hz = hjz
  41.   addEventHandler("onClientRender", root, movecamera)
  42.   addEventHandler("onClientRender", root, goodguy1)
  43.   function killz()
  44.     triggerServerEvent("onKillCamFinish", root, localPlayer, reciever, weapon)
  45.     fxAddBlood(hjx, hjy, hjz, 0, 0, 0, 5, 1)
  46.     removeEventHandler("onClientRender", root, goodguy1)
  47.     setGameSpeed(0.2)
  48.   end
  49.   setTimer(killz, 5000, 1)
  50.   if bodypart == 3 then
  51.     if moving then
  52.       text = "MOVING KILL"
  53.     else
  54.       text = "KILL"
  55.     end
  56.   elseif bodypart == 4 then
  57.     if moving then
  58.       text = "MOVING TESTICLE SHOOT"
  59.     else
  60.       text = "TESTICLE SHOT"
  61.     end
  62.   elseif bodypart == 9 then
  63.     if moving then
  64.       text = "MOVING HEADSHOT"
  65.     else
  66.       text = "HEADSHOT"
  67.     end
  68.   end
  69.   function setnormalcam()
  70.     removeEventHandler("onClientRender", root, movecamera)
  71.     setCameraTarget(localPlayer)
  72.     destroyElement(camobj)
  73.     setGameSpeed(1)
  74.     alpha = 255
  75.   end
  76.   setTimer(setnormalcam, 6000, 1)
  77. end
  78. addEvent("onSniperHeadshot", true)
  79. addEventHandler("onSniperHeadshot", root, killcam)
  80. function recievehs(shx, shy, shz, hitx, hity, hitz)
  81.   setGameSpeed(0.05)
  82.   target = createObject(327, shx, shy, shz)
  83.   setElementAlpha(target, 0)
  84.   moveObject(target, 5000, hitx, hity, hitz)
  85.   hx = hitx
  86.   hy = hity
  87.   hz = hitz
  88.   addEventHandler("onClientRender", root, movereciever)
  89.   addEventHandler("onClientRender", root, goodguy2)
  90.   function gods()
  91.     removeEventHandler("onClientRender", root, goodguy2)
  92.     setGameSpeed(0.2)
  93.   end
  94.   setTimer(gods, 5000, 1)
  95.   function endcam()
  96.     removeEventHandler("onClientRender", root, movereciever)
  97.     destroyElement(target)
  98.     setCameraTarget(localPlayer)
  99.     setGameSpeed(1)
  100.   end
  101.   setTimer(endcam, 6000, 1)
  102. end
  103. addEvent("onRecieveSniperHeadshot", true)
  104. addEventHandler("onRecieveSniperHeadshot", root, recievehs)
  105. function bloodhead(weapon, ammo, ammoclip, hx, hy, hz, hitelement, sx, sy, sz)
  106.   if weapon == 34 then
  107.     a = hx
  108.     s = hy
  109.     d = hz
  110.     function bloods()
  111.       fxAddBlood(a, s, d, 0, 0, 0, 5, 1)
  112.     end
  113.     setTimer(fxAddBlood, 3500, 1)
  114.   end
  115. end
  116. addEventHandler("onClientWeaponFire", root, bloodhead)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement