Jump to content

xRGamingx

Recommended Posts

local killed_players = {}

local imageTexture = dxCreateTexture("icon.png")

addEventHandler("onClientPlayerSpawn",getRootElement(),
function()
	if killed_players[source] then
		killed_players[source] = nil
	end
end)

addEventHandler("onClientPlayerWasted",getRootElement(),
function(killer)
	if killer == localPlayer then
		killed_players[source] = true
		setTimer(function(source)
			killed_players[source] = nil
		end,15000,1,source)
	end
end)

addEventHandler("onClientRender",getRootElement(),
function()
	for id,player in ipairs(getElementsByType("player")) do
		if killed_players[player] then
			local headPos = Vector3(getPedBonePosition(player,6))
			dxDrawMaterialLine3D(headPos.x,headPos.y,headPos.z,headPos.x,headPos.y,headPos.z+0.7,imageTexture,1)
		end
	end
end)

 

Link to comment
On 18/2/2018 at 04:06, IRBIS said:

local killed_players = {}

local imageTexture = dxCreateTexture("icon.png")

addEventHandler("onClientPlayerSpawn",getRootElement(),
function()
	if killed_players[source] then
		killed_players[source] = nil
	end
end)

addEventHandler("onClientPlayerWasted",getRootElement(),
function(killer)
	if killer == localPlayer then
		killed_players[source] = true
		setTimer(function(source)
			killed_players[source] = nil
		end,15000,1,source)
	end
end)

addEventHandler("onClientRender",getRootElement(),
function()
	for id,player in ipairs(getElementsByType("player")) do
		if killed_players[player] then
			local headPos = Vector3(getPedBonePosition(player,6))
			dxDrawMaterialLine3D(headPos.x,headPos.y,headPos.z,headPos.x,headPos.y,headPos.z+0.7,imageTexture,1)
		end
	end
end)

 

 

Hello friend, your code works as well, but you did it wrong

the image must replace the pointer of the weapon, for 15 seconds

And you made the image come up to the player who dies :3 

look

TXsRsyC.jpg

this must be replaced by the image for 15 seconds

OC2UYRn.png?1

Edited by xRGamingx
Link to comment
  • 3 weeks later...

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