Jump to content

[Help] Error


ÆBKV

Recommended Posts

function restoreAll()
  local r,g,b = getPlayerNametagColor(source)
  for index,players in ipairs(getElementsByType("player")) do
    if ghostmode == true then
      ghostmode = false
      setElementVisibleTo(source,players,true)
      setPlayerNametagShowing(source,true)
      setElementAlpha(source,255)
      createBlipAttachedTo(source,0,2,r,g,b,255)
    end
  end
end
addEvent("rAll",true)
addEventHandler("rAll",getRootElement(),restoreAll)

function restoreAllOnStop()
  triggerEvent("rAll",root)
end
addEventHandler("onResourceStop",getResourceRootElement(getThisResource()),restoreAllOnStop)

WARNING: ghostmode\ghostmode.lua:2: Bad argument @ 'getPlayerNametagColor' [Expected player at argument 1, got root]
WARNING: ghostmode\ghostmode.lua:9: Bad argument @ 'createBlipAttachedTo' [Expected number at argument 4, got boolean]

Does anyone know what's wrong here?

Link to comment
function restoreAll(thePlayer)
  local r,g,b = getPlayerNametagColor(thePlayer)
  for index,players in ipairs(getElementsByType("player")) do
    if ghostmode == true then
      ghostmode = false
      setElementVisibleTo(thePlayer,players,true)
      setPlayerNametagShowing(thePlayer,true)
      setElementAlpha(thePlayer,255)
      createBlipAttachedTo(thePlayer,0,2,r,g,b,255)
    end
  end
end
addEvent("rAll",true)
addEventHandler("rAll", root,restoreAll)

function restoreAllOnStop()
  triggerEvent("rAll",root)
end
addEventHandler("onResourceStop",resourceRoot ,restoreAllOnStop)

 

  • Thanks 1
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...