ÆBKV Posted January 23, 2018 Share Posted January 23, 2018 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
Dimos7 Posted January 23, 2018 Share Posted January 23, 2018 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) 1 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