Jump to content

help| script not working


scolen

Recommended Posts

This is a script I made. This has been working fine so far and then suddenly stopped working. What is the reason for it? 

addEvent("startMinerJob", true)

function startJob(thePlayer)

  if not (getElementData(thePlayer, "Jobs") == "miner") then 
    setElementData(thePlayer, "Jobs", "miner")
    setElementData(thePlayer, "copper", getElementData(thePlayer, "copper"))
  end
 
  mineMarker = createMarker(596.22632, 926.04364, -37.97111, "cylinder", 10.0)

    addEventHandler("onMarkerHit", mineMarker, function()
  
  
      playerWeapon = getPlayerWeapon(thePlayer)

      if playerWeapon == 23 then 

        outputChatBox("test", thePlayer)
        setPedFrozen(thePlayer, true)

        setTimer(function()
          setPedAnimation(thePlayer, "SWORD", "sword_4", -1, false, false, false, false)
        end, 1000, 5)

        setTimer(
            function() 
               outputChatBox("relesed", thePlayer)
               setPedFrozen(thePlayer, false)
               setElementData(thePlayer, "copper", getElementData(thePlayer, "copper")+3)
            end
        , 5000, 1)

      end

  
    end)
   
  

end
addEventHandler("startMinerJob", root, startJob)


--[[ Leave Miner Job Section  ]]

addEvent("leaveMinerJob", true)
function leaveJob(thePlayer)
   if (getElementData(thePlayer, "Jobs") == "miner") then 

      setElementData(thePlayer, "Jobs", nil)
      outputChatBox("you leaved miner job!", thePlayer, 0, 255, 0)

   end
end
addEventHandler("leaveMinerJob", root, leaveJob)


--[[ Job Testing Section  ]]
function test(thePlayer)

  de = getElementData(thePlayer, "copper")
  outputChatBox("you have "..de.." coppers")

 end

addCommandHandler("gg", test)

 

Link to comment
  • 2 weeks later...

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