opnaiC Posted May 11, 2016 Share Posted May 11, 2016 Can anybody help me to set the marker "gasstationmarkes" invisible for players? I know I need setElementVisibleTo but I tried to inject it into the script but it dont worked for me!? The marker is on the bottom of the script. Here is the script: local carFuel = {}; local gasStations = {}; local gasStationsBlip = {}; local gasStationsMarkers = {}; addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() local xml = xmlLoadFile("carData.xml"); local xmlNodes = xmlNodeGetChildren(xml); for i,node in ipairs(xmlNodes) do carFuel[tonumber(xmlNodeGetAttribute(node,'id'))] = tonumber(xmlNodeGetAttribute(node,'fuel')); end xmlUnloadFile(xml); local xml = xmlLoadFile("garageData.xml"); local xmlNodes = xmlNodeGetChildren(xml); for i,node in ipairs(xmlNodes) do local name = xmlNodeGetAttribute(node,'name'); local x = tonumber(xmlNodeGetAttribute(node,'x')); local y = tonumber(xmlNodeGetAttribute(node,'y')); local z = tonumber(xmlNodeGetAttribute(node,'z')); gasStationsBlip[name] = createBlip(x,y,z,51,0,0,0,0,0,0,450); local moreKids = xmlNodeGetChildren(node); gasStationsMarkers[name] = {}; for i,v in ipairs(moreKids) do local mx = tonumber(xmlNodeGetAttribute(v,'x')); local my = tonumber(xmlNodeGetAttribute(v,'y')); local mz = tonumber(xmlNodeGetAttribute(v,'z')); gasStationsMarkers[name][i] = createMarker(mx,my,mz,'corona',3,128,128,0,128); setElementData(gasStationsMarkers[name][i],'gasStation',true); end end xmlUnloadFile(xml); end ) Link to comment
ViRuZGamiing Posted May 11, 2016 Share Posted May 11, 2016 createMarker comes with an argument called visibleTo, serversided. visibleTo: This defines which elements can see the marker. Defaults to visible to everyone. See visibility. Link to comment
opnaiC Posted May 11, 2016 Author Share Posted May 11, 2016 createMarker comes with an argument called visibleTo, serversided.visibleTo: This defines which elements can see the marker. Defaults to visible to everyone. See visibility. So this would be that the player can see it right? gasStationsMarkers[name][i] = createMarker(mx,my,mz,'corona',3,128,128,0,128,getRootElement(player)); How I can setup it that nobody can see it ? Link to comment
ViRuZGamiing Posted May 11, 2016 Share Posted May 11, 2016 if no-one should be able to see it I suggest turning down the alpha to 0 Link to comment
opnaiC Posted May 11, 2016 Author Share Posted May 11, 2016 if no-one should be able to see it I suggest turning down the alpha to 0 Тhank you, I forgot about the alpha 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