Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function damaged(shooter, weapon, bodypart, loss)
- if (weapon == 34 or weapon == 33) and (bodypart == 9 or bodypart == 3 or bodypart == 4) then
- isInKillcam = getElementData(shooter, "killcam.isinkillcam")
- if not isInKillcam then
- setElementData(shooter, "killcam.isinkillcam", true)
- reciever = source
- health = getElementHealth(source)
- setElementHealth(source, health + loss)
- shx, shy, shz = getElementPosition(shooter)
- hitx, hity, hitz = getElementPosition(source)
- vx, vy, vz = getElementVelocity(reciever)
- if vx ~= 0 or vy ~= 0 or vz ~= 0 then
- moving = true
- else
- moving = false
- end
- triggerClientEvent(shooter, "onSniperHeadshot", root, shx, shy, shz, hitx, hity, hitz, bodypart, moving, reciever, weapon)
- triggerClientEvent(source, "onRecieveSniperHeadshot", root, shx, shy, shz, hitx, hity, hitz)
- end
- end
- end
- addEventHandler("onPlayerDamage", root, damaged)
- function killreciever(shooter, reciever, weapon)
- setElementData(shooter, "killcam.isinkillcam", false)
- killPed(reciever, shooter, weapon, 9)
- end
- addEvent("onKillCamFinish", true)
- addEventHandler("onKillCamFinish", root, killreciever)
Add Comment
Please, Sign In to add comment