Jacobob14 Posted February 16, 2014 Share Posted February 16, 2014 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
Mega9 Posted February 16, 2014 Share Posted February 16, 2014 If I got it correctly, you want to change label text when night vision is activated, right? Use function guiSetText Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now