sckatchof Posted January 11, 2012 Share Posted January 11, 2012 hello guys i have a spam problem like this in chat You have left the song area ! You have left the song area ! You have left the song area ! You have left the song area ! You have left the song area ! You have left the song area ! local radius = 150 local volume = 1.0 local posX, posY, posZ = 251.5, -1890.8000488281, 3.7000000476837 local radioURL = "http://www.true.nl/streams/slamfmlivestream.asx" local thisRoot = getResourceRootElement(getThisResource()) addEventHandler("onClientResourceStart", thisRoot, function() radio = playSound3D(radioURL, posX, posY, posZ, false) setSoundVolume(radio, volume) setSoundMaxDistance(radio, radius) end) addEventHandler("onClientRender", getRootElement(), function() local x, y, z = getElementPosition(getLocalPlayer()) if x and y and z then local distance = getDistanceBetweenPoints3D(x, y, z, posX, posY, posZ) if distance >= radius then outputChatBox("You have left the song area !") end end end) Link to comment
Thelastride Posted January 11, 2012 Share Posted January 11, 2012 This happens when you use event without knowing its function.Its because you put it in onClientRender event. Instead of this create a marker or something and use onMarkerExit Link to comment
Charlie_Jefferson Posted January 11, 2012 Share Posted January 11, 2012 Use a colshape and use onColShapeLeave, it's easier. Link to comment
Castillo Posted January 11, 2012 Share Posted January 11, 2012 This happens when you use event without knowing its function.Its because you put it in onClientRender event.Instead of this create a marker or something and use onMarkerExit Colshapes would be better for this kind of thing. P.S: It's "onMarkerLeave". 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