Jump to content

pedanimations


orcun99

Recommended Posts

server side

 

function sendHeadshot ( attacker, weapon, bodypart, loss )
local x, y, z = getElementPosition ( source)
	if (getZoneName (x, y, z, true) == "Las Venturas") then
	if attacker == getLocalPlayer() then
		if bodypart == 9 then
		setPedAnimation ( source, "KNIFE", "KILL_Knife_Ped_Damage", -1, false, false, false )
			triggerServerEvent( "onServerHeadshot", getRootElement(), source, attacker, weapon, loss )
			setElementHealth ( source, 0 )
			setPedHeadless( source, true )
			end
		end
	end
end
addEventHandler ( "onClientPlayerDamage", getRootElement(), sendHeadshot )

there is no anim  direct die

 

I want to IF player have headshot then          setPedAnimation ( source, "KNIFE", "KILL_Knife_Ped_Damage", -1, false, false, false )  1one time this anim   before die

Edited by orcun99
Link to comment
function sendHeadshot ( attacker, weapon, bodypart, loss )
local x, y, z = getElementPosition ( source)
	if (getZoneName (x, y, z, true) == "Las Venturas") then
	if attacker == getLocalPlayer() then
		if bodypart == 9 then
		setPedAnimation ( source, "KNIFE", "KILL_Knife_Ped_Damage", -1, false, false, false )
			triggerServerEvent( "onServerHeadshot", getRootElement(), source, attacker, weapon, loss )
			setPedHeadless( source, true )
			oldur()
			end
		end
	end
end
addEventHandler ( "onClientPlayerDamage", getRootElement(), sendHeadshot )


			
			function oldur ( player )
			setElementHealth ( source, 0 )
end
setTimer ( oldur, 2000, 1, "Hello, World!" )

 

21 hours ago, NeXuS™ said:

Try to edit it yourself. If you can't, I'll help you a bit.

note script client side

Edited by orcun99
Link to comment
function sendHeadshot ( attacker, weapon, bodypart, loss )
	local x, y, z = getElementPosition ( source)
	if (getZoneName (x, y, z, true) == "Las Venturas") then
		if attacker == getLocalPlayer() then
			if bodypart == 9 then
				setPedHeadless( source, true )
				setPedAnimation ( source, "KNIFE", "KILL_Knife_Ped_Damage", -1, false, false, false )
				setTimer(function()
					triggerServerEvent( "onServerHeadshot", getRootElement(), source, attacker, weapon, loss )
				end, 2000, 1)
			end
		end
	end
end
addEventHandler ( "onClientPlayerDamage", getRootElement(), sendHeadshot )

But, I dont get this.

How is the localPlayer going to damage his own head?

  • Thanks 2
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...