depato123 Posted May 30, 2013 Share Posted May 30, 2013 Hola amigos, tengo un resource de chat global para roleplays pero escribo el comando que le puse y no funciona function globalOOC( thePlayer, commandName, ... ) if getElementData(thePlayer, "loggedin") == true then if getElementData( thePlayer, "ooc" ) == 1 then local message = table.concat( { ... }, " " ) if #message > 0 then outputChatBox( "" .. string.gsub(getPlayerName( thePlayer ), "_", " ") .. " [GlobalOOC]: " .. message .. "", root, 0, 104, 139 ) else outputChatBox( "Usage: /" .. commandName .. " [OOC text]", thePlayer, 255, 255, 255 ) end end end end addCommandHandler("u", globalOOC) addCommandHandler("GlobalOOC", globalOOC) lo que pasa en el server: Say: /u Estoesunaprueba Link to comment
depato123 Posted May 30, 2013 Author Share Posted May 30, 2013 Algun error? si, no me reconoce el comando, osea que escribo /u texto y el texto no se manda a todo el server, nisiquiera a una parte Link to comment
Castillo Posted May 30, 2013 Share Posted May 30, 2013 No me entendiste, me refiero si sale algun error en el debugscript. Link to comment
depato123 Posted May 30, 2013 Author Share Posted May 30, 2013 No me entendiste, me refiero si sale algun error en el debugscript. Ya lo resolví ahora tengo otra duda -- Anuncios para ventas u demas cosas -- Ejemplo: /an Vendo Bullet barato #49546566 function publicChat(thePlayer, commandName, ...) local players = getElementsByType("player") local playerName = getClientName ( thePlayer ) local chatContent = {...} for index, player in ipairs ( players ) do outputChatBox( "[Anuncio] ".. playerName.. ": " ..table.concat ( chatContent, " "), player, 50, 200, 100) end end addCommandHandler( "an", publicChat ) ¿como puedo sacar el playerName de la linea 8? así nadie sabe quien envió el anuncio Link to comment
FraN-724 Posted May 30, 2013 Share Posted May 30, 2013 Intenta esto -- Anuncios para ventas u demas cosas -- Ejemplo: /an Vendo Bullet barato #49546566 function publicChat(thePlayer, commandName, ...) local players = getElementsByType("player") local chatContent = {...} for index, player in ipairs ( players ) do outputChatBox( "[Anuncio]:" ..table.concat ( chatContent, " "), player, 50, 200, 100) end end addCommandHandler( "an", publicChat ) Link to comment
AlvareZ_ Posted May 30, 2013 Share Posted May 30, 2013 ... ? -- Anuncios para ventas u demas cosas -- Ejemplo: /an Vendo Bullet barato #49546566 function publicChat(thePlayer, commandName, ...) local players = getElementsByType("player") local chatContent = {...} for index, player in ipairs ( players ) do outputChatBox( "[Anuncio] " ..table.concat ( chatContent, " "), player, 50, 200, 100) end end addCommandHandler( "an", publicChat ) Link to comment
Recommended Posts