Sasu Posted March 10, 2013 Share Posted March 10, 2013 function evento(source) if (isElement(theMarker)) then destroyElement(theMarker) local nombre2 = getPlayerName(source) outputChatBox("#FF0000[AVISO]#00FF00Eventos removidos por #0000FF"..nombre2.."#00FF00.", getRootElement(), 255, 255, 255, true) removeCommandHandler("eventwarp") else local x,y,z = getElementPosition(source) local theMarker = createMarker ( x, y, z, "checkpoint", 2, 255, 255, 255, 100 ) local nombre = getPlayerName(source) outputChatBox("#FF0000[AVISO]#00FF00Se ha creado un evento por #0000FF"..nombre..". #00FF00Usa #FF0000/eventwarp #00FF00para participar!", getRootElement(), 255, 255, 255, true) addCommandHandler("eventwarp", eventowarp) end end addCommandHandler("event", evento) function eventowarp(thePlayer) if isElement(theMarker) then setElementPosition( thePlayer, x, y, z) end end Its create the marker but when I executed the command "event" again its create another marker. Also "eventwarp" It doesnt work. Can you help me? Link to comment
TAPL Posted March 10, 2013 Share Posted March 10, 2013 Try function evento(source) if (isElement(theMarker)) then destroyElement(theMarker) local nombre2 = getPlayerName(source) outputChatBox("#FF0000[AVISO]#00FF00Eventos removidos por #0000FF"..nombre2.."#00FF00.", getRootElement(), 255, 255, 255, true) removeCommandHandler("eventwarp") else local x,y,z = getElementPosition(source) theMarker = createMarker ( x, y, z, "checkpoint", 2, 255, 255, 255, 100 ) local nombre = getPlayerName(source) outputChatBox("#FF0000[AVISO]#00FF00Se ha creado un evento por #0000FF"..nombre..". #00FF00Usa #FF0000/eventwarp #00FF00para participar!", getRootElement(), 255, 255, 255, true) addCommandHandler("eventwarp", eventowarp) end end addCommandHandler("event", evento) function eventowarp(thePlayer) if isElement(theMarker) then local x, y, z = getElementPosition(theMarker) setElementPosition(thePlayer, x, y, z) end end Link to comment
Sasu Posted March 10, 2013 Author Share Posted March 10, 2013 Try function evento(source) if (isElement(theMarker)) then destroyElement(theMarker) local nombre2 = getPlayerName(source) outputChatBox("#FF0000[AVISO]#00FF00Eventos removidos por #0000FF"..nombre2.."#00FF00.", getRootElement(), 255, 255, 255, true) removeCommandHandler("eventwarp") else local x,y,z = getElementPosition(source) theMarker = createMarker ( x, y, z, "checkpoint", 2, 255, 255, 255, 100 ) local nombre = getPlayerName(source) outputChatBox("#FF0000[AVISO]#00FF00Se ha creado un evento por #0000FF"..nombre..". #00FF00Usa #FF0000/eventwarp #00FF00para participar!", getRootElement(), 255, 255, 255, true) addCommandHandler("eventwarp", eventowarp) end end addCommandHandler("event", evento) function eventowarp(thePlayer) if isElement(theMarker) then local x, y, z = getElementPosition(theMarker) setElementPosition(thePlayer, x, y, z) end end Perfect. Thank you very much. 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