AnnaBelle Posted April 18, 2017 Share Posted April 18, 2017 addEventHandler("onResourceStart",getRootElement(),function(thePlayer) if(getElementData(thePlayer,"Group")== "Testing" )then blip = createBlip(100,20,0,31) setBlipVisibleDistance(blip,1000) end end) error getElementData Link to comment
AnnaBelle Posted April 18, 2017 Author Share Posted April 18, 2017 blip\script.lua:2: Bad argument @ 'getElementData' [Expected element at argument 1, got resource-data] Link to comment
#BrosS Posted April 18, 2017 Share Posted April 18, 2017 try it on client side , it worked for me addEventHandler("onClientResourceStart",resourceRoot, function() if(getElementData(localPlayer,"Group")== "Test" )then blip = createBlip(100,20,0,31) setBlipVisibleDistance(blip,1000) end end) Link to comment
AnnaBelle Posted April 18, 2017 Author Share Posted April 18, 2017 When I leave the group the blip is still appearing Link to comment
szekelymilan Posted April 18, 2017 Share Posted April 18, 2017 (edited) On the leave command, just destroy the blip. function leaveTestGroup () -- your code -- ... if (blip) then destroyElement (blip) blip = nil end end addCommandHandler ("leave", leaveTestGroup) Edited April 18, 2017 by MakroBox 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