Jump to content

[HELP-ME]Pvp system, without delay 0.003ms per shot.


AnnaBelle

Recommended Posts

Posted

Please, explain better your request/problem. Otherwise no one will help 'cause anyone (atleast me) can't understand what are you talking about.

Posted
10 hours ago, AnnaBelle said:

I'm looking for the hitmarker with no bug, type the shot in the lag, so it would be a hitmarker that helps in combat

just use event onClientPedDamage then just show hit mark image, no delay whatsoever.

Posted (edited)
local screenX, screenY
local drawTimer
local isDrawing
local sound

function drawHitMarker()
	dxDrawImage(screenX-16, screenY-16, 32, 32, "hitmarker.png")
end

addEventHandler("onClientPedDamage", getRootElement(),
function(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement)
if hitElement then
	if getElementType(hitElement)== "vehicle" or getElementType(hitElement)== "player" then
		screenX, screenY = getScreenFromWorldPosition(hitX, hitY, hitZ)
		if not screenX then return end 
		if isDrawing then return end 
		isDrawing = true
		local sound = playSound("hitmarker-sound.wav")
		setSoundVolume( sound , 1)	
		addEventHandler("onClientRender", root, drawHitMarker) 
		if drawTimer and isTimer(drawTimer) then
			killTimer(drawTimer)
		end
		drawTimer = setTimer(function() 
			isDrawing = false
			removeEventHandler("onClientRender", root, drawHitMarker) 
		end, 500, 1)
	end
	end
end)

Like this?

Edited by AnnaBelle

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