Jump to content

[Ajuda] OnPlayerDamage


Recommended Posts

Olá gente !

Bom o meu problema é o seguinte, esta parte do meu resource envés de "ativar" para quem dá dano está "ativando" para quem recebe dano.

O que posso fazer para que ative para quem dá o dano?

Obrigado desde já ❤️ 

addEventHandler( "onPlayerDamage", root,
	function (targetElem)
		if (bodypart == 3 or 4 or 5 or 6 or 7 or 8 or 9 ) then
			if (targetElem and targetElem:getType("player") and source:getWeapon() == 23) then
				if (source:getData("Venda:Police.Job")) then
					if (targetElem:getWantedLevel() == 0) then
						return addNotification(source, "Essa pessoa não está com nível de procurado!", "error");
					elseif (not Boxs["Markers"]["Create"]["Vehicle"][source]) then
						return addNotification(source, "Nenhuma viatura encontrada para levar o sujeito!", "error");
					end
					if (targetElem:getHealth() >= 31) then
						setElementVisibleTo(Boxs["Markers"]["Create"]["Jail"], source, true);
						targetElem:setAnimation("ped","CAR_dead_LHS");
						targetElem:attach(Boxs["Markers"]["Create"]["Vehicle"][source], 0.2, -1.5, 0, 0, 0, 90);
						addNotification(targetElem, "Tu acabas-te de ser algemado e preso, espera ser encaminhado para a cadeia.", "info");
						addNotification(source, "Tu prendes-te uma pessoa! Leva-a até ao departamento (Sirenes Azuis)", "info");
					end
				end
			end
		end
	end
)

 

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...