Jump to content

[HELP]Works when pressed


mucuk6547

Recommended Posts

Hi I found a script and I do not want to do it right-click+shift just want to be pressing f

Code:


bindKey("aim_weapon", "both", function(key, keyState)
	if keyState == "down" then
		checkWeapon(localPlayer)
	else
		removeVision(localPlayer)
	end
end)

function checkWeapon(weapon, newSlot, oldSlot)
   if getPedWeapon(getLocalPlayer(),newSlot) == 44 then
      bindKey("F", "down", setVisionMode)
      showText(localPlayer)
      else
	  unbindKey("F")
	  destroyText(localPlayer)
     end
end

function removeVision()
setCameraGoggleEffect("normal")
destroyText(localPlayer)
unbindKey("F")
end

function destroyText(newSlot)
if (getPedWeapon(getLocalPlayer(),newSlot) == 44) then
destroyElement(adv)
else
unbindKey("F")
end
end

function setVisionMode()
	if(getCameraGoggleEffect() == "normal")then
		setCameraGoggleEffect("nightvision")
	elseif(getCameraGoggleEffect() == "nightvision")then
		setCameraGoggleEffect("thermalvision")
	elseif(getCameraGoggleEffect() == "thermalvision")then
		setCameraGoggleEffect("normal")
	end
end

function showText()
adv = guiCreateLabel(-0.00, 0.37, 0.18, 0.14, "-Gorusler arasinda gecis icin -\tusuna \"F\" bas", true)
guiSetFont(adv, "default-bold-small")
guiLabelSetHorizontalAlign(adv, "center", false)
guiLabelSetVerticalAlign(adv, "center")    
end

addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()),
function (resource)
outputDebugString("* Resource name: "..getResourceName(resource).." | Version 1.0 | Made by Arslan.A  [Started]") 
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...