Carlossg Posted January 29, 2012 Posted January 29, 2012 Buenas,hoy he tenido una idea y es un traductor , por el momento de frases hechas, y mi pregunta es ¿Cómo puedo leer como se escribe en el chatbox?(en lúa claro), y¿Cómo puedo evitar que salga lo que un usuario escribe, sino que salga el mensage traducido?
Castillo Posted January 29, 2012 Posted January 29, 2012 function playerChat(message, messageType) if (messageType == 0 and string.lower(message) == "hello") then -- Si el tipo de chat es el principal y el mensaje es "Hello".. cancelEvent() -- Cancelamos el mensaje. local r, g, b = getPlayerNametagColor(source) -- Obtenemos el color del nametag del jugador. outputChatBox(getPlayerName(source)..": #FFFFFFhola", root, r, g, b, true) -- Enviamos un mensaje a todo el servidor con el nuevo texto. end end addEventHandler("onPlayerChat", root, playerChat) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Carlossg Posted January 29, 2012 Author Posted January 29, 2012 Muchas gracias me pondré manos a la obra, una cosa ¿Client-side o Server-side?
Castillo Posted January 29, 2012 Posted January 29, 2012 Server side. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Recommended Posts