Jump to content

Big Marker


Tekken

Recommended Posts

i am already created a useful function to disable a high of marker u can use it

but u should add marker event's like that

addEventHandler('onMarkerHit',here should be marker not root,function()

..etc

)

source code:

function disableMarkerHighet(themarker,evname,high,tt)
	assert ( type ( evname ) == "string", "Bad Argument @ 'EventName' [ Expected string at argument 2, got " .. type ( evname ) .. " ]" )
		local ta,x,y,z={},getElementPosition(themarker)
			if #getEventHandlers( evname, themarker )==0 then error('No functions Handlers for this marker') return end
				for k,v in ipairs(getEventHandlers( evname, themarker ))do
					removeEventHandler(evname, themarker, v)
						table.insert(ta,v)
							end
								local tt=tt or false
									addEventHandler(evname,themarker,function(plr,dim)
											if dim==tt or (tt==false and dim==true) then
												local xp,yp,zp=getElementPosition(plr)
											if zp<=z+high then
									for k,v in ipairs(ta)do
								v(plr,dim)
							end
						end
					end
				end)
			end

put it on the first of the file

and the syntax is:

disableMarkerHighet(element marker,string eventname,int high,bolean tt)

the arguments is:

marker: the marker which you want to disable high for it

eventname: maybe be 'onMarkerHit' or 'onMarkerLeave' or 'onClientMarkerHit' or 'onClientMarkerLeave'

 high: type( number)  the allowed high to post the event 

tt: for check the dim when player hit or leave the marker u can leave it and didn't right any thing in it

now let's show you some examples:

example 1 wrong example:

local marker=createMarker(0,0,0,'clyinder',17,255,255,255)
disableMarkerHighet(marker,'onMarkerHit',10,true)---------------wromg place the disable function must be after the event wich you want
addEventHandler('onMarkerHit',marker,function()
    outputChatBox('wrong Example')
    end)
-----------------like herer

example 2 also wrong :

local marker=createMarker(0,0,0,'clyinder',17,255,255,255)
addEventHandler('onMarkerHit',root----[[should be here marker or function will not work]]--------------------- root must be the marker or the function will not work
  ,function()
    if source==marker then
    outputChatBox('wrong Example')
    end
    end)
disableMarkerHighet(marker,'onMarkerHit',10,true)

example 3 right example :

local marker=createMarker(0,0,0,'clyinder',17,255,255,255)
addEventHandler('onMarkerHit',marker
  ,function()
    outputChatBox('wrong Example')
    end)
disableMarkerHighet(marker,'onMarkerHit',10,true)

that function if you was higher than 10 from marker then the event attached to marker will not work

hope that was help you

Link to comment

Sorry but none of you guys help me, as I already said I can't use the marker thing, I just need to find a way to create a big circle on the map. Like I don't know drawing a D3 circle or something. It just needs to be there, to be seen it doesn't need to have a collision.

Edited by Tekken
-
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...