Nonameman Posted June 3, 2013 Share Posted June 3, 2013 (edited) Hello, I'm creating a house system, but I ran into a problem I can't solve. I want to handle when a player hits a house entrance's marker, but it only works once, the second time I hit the marker, there's no server reaction. function houseMarkerHit ( elem, matchingDimension ) if getElementType ( elem ) == "player" then outputChatBox ( "Marker hit", elem ) end end addEventHandler ( "onMarkerHit", root, houseMarkerHit ) How could I solve this problem? Thanks Nonameman Edited June 3, 2013 by Guest Link to comment
iPrestege Posted June 3, 2013 Share Posted June 3, 2013 That's because there's no player element on the chat box function also when you hit any client marker at you're server you'll get this message . Link to comment
Nonameman Posted June 3, 2013 Author Share Posted June 3, 2013 (edited) That's because there's no player element on the chat box function also when you hit any client marker at you're server you'll get this message . Sorry, code was wrong, the script is server-side, edited it, but still not working. Only triggers when the first hit happens. Edited June 3, 2013 by Guest Link to comment
Nonameman Posted June 3, 2013 Author Share Posted June 3, 2013 local houses = {} local nextHouse = 0 function createHouse ( player, commandName, name ) local x, y, z = getElementPosition ( player ) z = z - 1 local hMarker = createMarker ( x, y, z, "cylinder", 1.0 ) if not name then name = "House #" .. nextHouse end if hMarker then houses[nextHouse] = {} houses[nextHouse].marker = hMarker houses[nextHouse].name = name outputChatBox ( "House has been created!", player ) nextHouse = nextHouse + 1 else outputChatBox ( "House can't be created!", player ) end end addCommandHandler ( "chouse", createHouse, false ) ... -- And the previously written code SOLVED: Marker was too small.. -.-" 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