Jump to content

Necesito ayuda con chat global


Recommended Posts

Posted

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 
                                              

Posted

Algun error?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

No me entendiste, me refiero si sale algun error en el debugscript.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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

Posted

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 ) 

Posted

... ?

-- 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 ) 

bandera_de_Venezuela.png

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...