Destroyer.- Posted July 28, 2016 Share Posted July 28, 2016 Hi, I have a problem with creating a marker with a table, create the marker, but it gives me a warn to debug and not found local marker = {} function Test() marker[source] = createMarker(-1055.3283691406,-1679.3109130859,76,"cylinder",5.5,255,255,0,170 ) end addEvent("Test", true) addEventHandler("Test",root,Test) function TestMarker() exports.sidechat:outputSideChat ( "test", 255, 0, 0) end addEventHandler("onClientMarkerHit",marker[source],TestMarker) Link to comment
Hale Posted July 28, 2016 Share Posted July 28, 2016 Is anything being output on the debug? (/debugscript) Link to comment
EstrategiaGTA Posted July 28, 2016 Share Posted July 28, 2016 Where is source defined, when you are inserting it into the table? Link to comment
!#NssoR_) Posted July 28, 2016 Share Posted July 28, 2016 local marker = {} addEvent("Test", true) function Test() marker[source] = createMarker(-1055.3283691406,-1679.3109130859,76,"cylinder",5.5,255,255,0,170 ) addEventHandler("onClientMarkerHit",marker[source],TestMarker) end addEventHandler("Test",root,Test) function TestMarker() exports.sidechat:outputSideChat ( "test", 255, 0, 0) end Link to comment
Destroyer.- Posted July 28, 2016 Author Share Posted July 28, 2016 Where is source defined, when you are inserting it into the table? I modified the argument localplayer , and I also pulls the warn, throws me nil in the second argument of the event. how could I fix it? Link to comment
EstrategiaGTA Posted July 29, 2016 Share Posted July 29, 2016 local marker = {} function Test() marker[source] = createMarker(-1055.3283691406,-1679.3109130859,76,"cylinder",5.5,255,255,0,170 ) end addEvent("Test", true) addEventHandler("Test",root,Test) function TestMarker(hitPlayer) if source == marker[hitPlayer] then exports.sidechat:outputSideChat ( "test", 255, 0, 0) end end addEventHandler("onClientMarkerHit", root,TestMarker) Try with this. 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