function Paczka(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement)
if (getElementData(localPlayer,"TEST")==true) then
if (weapon==35) then
if isPedAiming(localPlayer) then
local x,y,z = getElementPosition(localPlayer)
local w, h = guiGetScreenSize ()
local x2,y2,z2 = getWorldFromScreenPosition ( w/2, h/2,10,10)
local obiekt = createObject(964,x,y,z+1)
moveObject(obiekt,500,x2,y2,z2)
else
end
else
end
else
end
end
addEventHandler("onClientPlayerWeaponFire",root,Paczka)
function isPedAiming ( thePedToCheck )
if isElement(thePedToCheck) then
if getElementType(thePedToCheck) == "player" or getElementType(thePedToCheck) == "ped" then
if getPedTask(thePedToCheck, "secondary", 0) == "TASK_SIMPLE_USE_GUN" then
return true
end
end
end
return false
end