Jump to content

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


koragg

Recommended Posts

Posted

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.

G6HYac9.jpg

I love rock/metal/pop but don't mind any other music genre except чалга...that thing sux 
I also love cars

PS I'm friendly

Posted

You're using setElementVisibleTo, which is server-sided.
race_client.lua creates the markers on the client.

Try using a client-sided script

Posted (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 by koragg

G6HYac9.jpg

I love rock/metal/pop but don't mind any other music genre except чалга...that thing sux 
I also love cars

PS I'm friendly

Posted (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 by koragg
Both markers and blips can be max 2.

G6HYac9.jpg

I love rock/metal/pop but don't mind any other music genre except чалга...that thing sux 
I also love cars

PS I'm friendly

Posted
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?

Posted
50 minutes ago, Gr0x said:

I'm assuming that's not a client sided script then, is it?

It is :D Idk why it says 0, like they're not of type 'marker' or something.

G6HYac9.jpg

I love rock/metal/pop but don't mind any other music genre except чалга...that thing sux 
I also love cars

PS I'm friendly

Posted
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

 

Posted
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 :)

G6HYac9.jpg

I love rock/metal/pop but don't mind any other music genre except чалга...that thing sux 
I also love cars

PS I'm friendly

Posted

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

G6HYac9.jpg

I love rock/metal/pop but don't mind any other music genre except чалга...that thing sux 
I also love cars

PS I'm friendly

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