koragg Posted October 15, 2017 Share Posted October 15, 2017 So I want to hide checkpoint markers and blips created by the map itself. The blips were no problem - I got them via getElementsByType("blip") and set their alpha to 0. But the markers are the problem here because I can't get them with getElementsByType("marker"). It says there are 0 markers when there are 2 right infront of me. So since I can't get them I also can't use setElementVisibleTo or destroy them when needed. Any help? They get created on map start by the "createCheckpoint()" function in 'race_client.lua' file inside the race.zip resource. I don't get why blips work fine but markers don't, but I think it's got something to do with the "createCheckpoint()" function as it has a return value ("checkpoint.marker"). Maybe that prevents me to find all markers somehow? No idea, they're made using the normal 'createMarker()' function so it should work. Link to comment
Gr0x Posted October 15, 2017 Share Posted October 15, 2017 You're using setElementVisibleTo, which is server-sided. race_client.lua creates the markers on the client. Try using a client-sided script Link to comment
koragg Posted October 15, 2017 Author Share Posted October 15, 2017 (edited) 32 minutes ago, Gr0x said: You're using setElementVisibleTo, which is server-sided. race_client.lua creates the markers on the client. Try using a client-sided script Thing is that i can't get them with getElementsByType for some reason so i can't destroy them on the client. Edited October 15, 2017 by koragg Link to comment
Gr0x Posted October 15, 2017 Share Posted October 15, 2017 It worked fine for me when I tried, if I understood your question correctly. Could you show me the code you're using? Link to comment
koragg Posted October 15, 2017 Author Share Posted October 15, 2017 (edited) 33 minutes ago, Gr0x said: It worked fine for me when I tried, if I understood your question correctly. Could you show me the code you're using? Well the easiest way to see if they get detected is this, and it shows 0 in chatbox. function markersTest() local markers = getElementsByType("marker") outputChatBox(#markers) end addCommandHandler("markerstest", markersTest) While doing the same for blips shows 2. Edited October 15, 2017 by koragg Both markers and blips can be max 2. Link to comment
Gr0x Posted October 15, 2017 Share Posted October 15, 2017 27 minutes ago, koragg said: Well the easiest way to see if they get detected is this, and it shows 0 in chatbox. function markersTest() local markers = getElementsByType("marker") outputChatBox(#markers) end addCommandHandler("markerstest", markersTest) While doing the same for blips shows 2. I'm assuming that's not a client sided script then, is it? Link to comment
koragg Posted October 15, 2017 Author Share Posted October 15, 2017 50 minutes ago, Gr0x said: I'm assuming that's not a client sided script then, is it? It is Idk why it says 0, like they're not of type 'marker' or something. Link to comment
Gr0x Posted October 15, 2017 Share Posted October 15, 2017 1 hour ago, koragg said: It is Idk why it says 0, like they're not of type 'marker' or something. Then I don't know what the problem is, it totally worked fine for me. I could hide the markers and blips using runcode These are the commands I used: crun for q,w in pairs(getElementsByType("marker")) do setMarkerSize(w,0) end crun for q,w in pairs(getElementsByType("blip")) do setBlipColor(w,255,255,255,0) end Link to comment
koragg Posted October 15, 2017 Author Share Posted October 15, 2017 27 minutes ago, Gr0x said: Then I don't know what the problem is, it totally worked fine for me. I could hide the markers and blips using runcode These are the commands I used: crun for q,w in pairs(getElementsByType("marker")) do setMarkerSize(w,0) end crun for q,w in pairs(getElementsByType("blip")) do setBlipColor(w,255,255,255,0) end Yeah I hid blips exactly the same way but markers couldn't. But hello setMarkerSize(), this is a nice idea Link to comment
koragg Posted October 15, 2017 Author Share Posted October 15, 2017 I don't get it... yesterday it didn't work. It showed 0 markers and they stayed untouched. I did the same thing today and everything's fine ._. what 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