Jump to content

sniper vision


Jacobob14

Recommended Posts

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) == 34 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) == 34) 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, "Vision Normal press f", 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 |")  
end) 

as might i do so that when I change the vision way out other text

guiCreateLabel adv = (-0.00, 0.37, 0.18, 0.14, "Vision Normal press f", true)

different as night mode activated forgive my bad English :(

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