Kenix Posted September 13, 2011 Share Posted September 13, 2011 So i have problem with markers: addEventHandler("onGamemodeMapStart", root, function( startedMap ) local general_marker = getElementsByType ("Capture_marker") for i,v in ipairs(general_marker) do markerPssing[i] = createMarker(getElementData( v,"posX"),getElementData( v,"posY"),getElementData( v,"posZ"),"cylinder",1.5,153,77,39,255) end addEventHandler("onMarkerHit",root, function( player, dim ) if source == markerPassing[1] then outputChatBox("1") elseif source == markerPassing[2] then outputChatBox("2") elseif source == markerPassing[3] then outputChatBox("3") elseif source == markerPassing[4] then outputChatBox("4") else outputChatBox("error") end end ) end ) Debug:ERROR: zombie_mod\core_server.lua:5: attempt to index global 'markerPassing' (a nil value) But if i not use variable "markerPassing" markers are create and not write errors. Thx in advance. Link to comment
Aibo Posted September 13, 2011 Share Posted September 13, 2011 1. markerPassing is not declared anywhere as a table. 2. on line 5 its missing a letter: markerPssing. Link to comment
Kenix Posted September 13, 2011 Author Share Posted September 13, 2011 So i fix thx dude but i have question How can I determine which marker on the account? I need check number marker in hit. Link to comment
BinSlayer1 Posted September 13, 2011 Share Posted September 13, 2011 Please try to explain better what you want to do, I'm not understanding it at all Link to comment
Kenix Posted September 13, 2011 Author Share Posted September 13, 2011 I'm creating passing mode, all the markers made in edf So I need to get id marker which hit a player. Example if source == marker[1] then -- .. elseif source == marker[2] then --and etc end Link to comment
BinSlayer1 Posted September 13, 2011 Share Posted September 13, 2011 Not sure if I know what you mean, but can't you just setElementData on the marker with the id when you create it in the FOR ? 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