orcun99 Posted September 2, 2017 Share Posted September 2, 2017 (edited) local theMarker = createMarker ( -283.43835449219,1470.9427490234,1083.2, "cylinder", 1.5, 255, 255, 0, 170 ) setElementInterior(theMarker, 15) setElementDimension(theMarker, 3) function theMarker(thePlayer, matchingDimension) for i, p in ipairs(getElementsByType("player")) do if isElementWithinMarker(p, theMarker) then setElementDimension ( source, 0 ) setElementInterior ( source, 0, -2033.7825927734,2335.9631347656,4.9999980926514 ) outputChatBox("oldu", thePlayer, 255, 0, 0) else outputChatBox("hata!", thePlayer, 255, 0, 0) end end end why this is not work Edited September 2, 2017 by orcun99 Link to comment
WorthlessCynomys Posted September 2, 2017 Share Posted September 2, 2017 Are the marker and the player in the same dimension? Link to comment
orcun99 Posted September 2, 2017 Author Share Posted September 2, 2017 Just now, StormFighter said: Are the marker and the player in the same dimension? yep marker dim3 and int 15 so I check myself in adminpanel my dim3 and int15 but dosen't work Link to comment
WorthlessCynomys Posted September 2, 2017 Share Posted September 2, 2017 You call this function somehow, right? Link to comment
orcun99 Posted September 2, 2017 Author Share Posted September 2, 2017 9 minutes ago, StormFighter said: You call this function somehow, right? uhm no this is client side in meta.xml and I can see marker but when I'm inside market do nothing Link to comment
WorthlessCynomys Posted September 2, 2017 Share Posted September 2, 2017 Just now, orcun99 said: uhm no this is client side in meta.xml and I can see marker but when I'm inside market do nothing You have to call that function to get it work. You can do this with a simple event, and addEventHandler. This event is onClientMarkerHit ON CLIENT SIDE. So like: 1 hour ago, orcun99 said: local theMarker = createMarker ( -283.43835449219,1470.9427490234,1083.2, "cylinder", 1.5, 255, 255, 0, 170 ) setElementInterior(theMarker, 15) setElementDimension(theMarker, 3) function theMarker(thePlayer, matchingDimension) for i, p in ipairs(getElementsByType("player")) do if isElementWithinMarker(p, theMarker) then setElementDimension ( source, 0 ) setElementInterior ( source, 0, -2033.7825927734,2335.9631347656,4.9999980926514 ) outputChatBox("oldu", thePlayer, 255, 0, 0) else outputChatBox("hata!", thePlayer, 255, 0, 0) end end end addEventHandler("onClientMarkerHit", theMarker, theMarker) -- If this does not work, change the function name to something else, because it can be messed up with your variable that contains the actual marker. Link to comment
orcun99 Posted September 3, 2017 Author Share Posted September 3, 2017 (edited) local theMarker = createMarker ( -283.43835449219,1470.9427490234,1083.2, "cylinder", 1.5, 255, 255, 0, 170 ) setElementInterior(theMarker, 15) setElementDimension(theMarker, 3) function theMarker2(thePlayer, matchingDimension) for i, p in ipairs(getElementsByType("player")) do if isElementWithinMarker(p, theMarker) then setElementDimension ( source, 0 ) setElementInterior ( source, 0, -2033.7825927734,2335.9631347656,4.9999980926514 ) outputChatBox("oldu", thePlayer, 255, 0, 0) else outputChatBox("hata!", thePlayer, 255, 0, 0) end end end addEventHandler("onClientMarkerHit", theMarker2, theMarker) still not work bro Edited September 3, 2017 by orcun99 Link to comment
Moderators IIYAMA Posted September 3, 2017 Moderators Share Posted September 3, 2017 (edited) You have to do this serverside. As client you do not have the full authority to change the behaviour of other players. You can change it, but with the next synchronisation update it will be reset. And most importantly, it can cause desync for the players. The structure of the code is original serverside based, see syntax of outputChatBox when used serverside. outputChatBox And don't forget to debug the code in all possible ways, see debug tutorial for a better way to figure out what your code does and doesn't. Edited September 3, 2017 by IIYAMA 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