Jump to content

[HELP] Hide default checkpoint markers (race.zip)


koragg

Recommended Posts

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
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 by koragg
Link to comment
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 by koragg
Both markers and blips can be max 2.
Link to comment
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
1 hour ago, koragg said:

It is :D 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
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

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...