Apo Posted October 8, 2016 Share Posted October 8, 2016 hi guys please help me for hit my mark my problem all player can hit my mark i need only The player who has used the command can hit mark blip = nil marker = nil function mark(thePlayer) if blip == nil and marker == nil then local x, y, z = 1819.8046875, -1831.2685546875, 13.4140625 local z = z - 1 marker = createMarker( x, y, z, "cylinder", 2, 255, 0, 0, 150, getRootElement(thePlayer )) blip= createBlipAttachedTo(marker, 0, 2, 255, 0, 255, 255) setElementVisibleTo(marker, getRootElement(), false) setElementVisibleTo(marker, thePlayer, true) else destroyElement(blip) destroyElement(marker) blip = nil marker = nil end end addCommandHandler("mark", mark, false, false) function markhit (element) if (source == marker) then destroyElement(marker) destroyElement(blip) end end addEventHandler("onMarkerHit", root, markhit) Link to comment
Mr.Loki Posted October 8, 2016 Share Posted October 8, 2016 (edited) you can make the marker and blip clientside so only the pweson who uses the command can see them. #Post100 Edited October 8, 2016 by loki2143 1 Link to comment
Apo Posted October 8, 2016 Author Share Posted October 8, 2016 yes only player who uses command can see marker but all player can hit marker Link to comment
Gravestone Posted October 8, 2016 Share Posted October 8, 2016 (edited) Use isElementVisibleTo to check if the player element can see the marker, if not, cancel the event. Edited October 8, 2016 by Gravestone Link to comment
iPrestege Posted October 8, 2016 Share Posted October 8, 2016 Also use table to create marker and blip to the player. 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