Jump to content

Ayuda con chat


depato123

Recommended Posts

Tengo un problema con un resource de chat

script:

function cnnChat(thePlayer, commandName, ...) 
    if ( getPlayerTeam ( thePlayer ) and getTeamName ( getPlayerTeam ( thePlayer) ) == "Reporteros de CNN" ) 
        local players = getElementsByType("player") 
        local playerName = getPlayerName ( thePlayer ) 
        local chatContent = {...} 
        for index, player in ipairs ( players ) do 
            outputChatBox( "[CNN] ".. playerName.. ": " ..table.concat ( chatContent, " "), player, 196, 255, 255) 
        end 
    else 
        outputChatBox( "No eres de reportero de cnn"), player, 196, 255, 255) 
    end 
addCommandHandler( "sr", cnnChat ) 

el error

[2013-11-10 15:16:38] SCRIPT ERROR: [gamemodes]\[play]\[addons]\chat\s_chat.lua:118: 'then' expected near 'local'

[2013-11-10 15:16:38] ERROR: Loading script failed: [gamemodes]\[play]\[addons]\chat\s_chat.lua:118: 'then' expected near 'local'

El script tendria que hacer que los que son del team "Reporteros de cnn" puedan hablar globalmente usando el comando /sr texto. pero no funciona ayudaaa

Link to comment
function cnnChat(thePlayer, commandName, ...) 
    if ( getPlayerTeam ( thePlayer ) and getTeamName ( getPlayerTeam ( thePlayer) ) == "Reporteros de CNN" ) then 
        local players = getElementsByType("player") 
        local playerName = getPlayerName ( thePlayer ) 
        local chatContent = {...} 
        for index, player in ipairs ( players ) do 
            outputChatBox( "[CNN] ".. playerName.. ": " ..table.concat ( chatContent, " "), player, 196, 255, 255) 
        end 
    else 
        outputChatBox( "No eres de reportero de cnn"), player, 196, 255, 255) 
    end 
addCommandHandler( "sr", cnnChat )--]] 

[2013-11-10 15:27:37] SCRIPT ERROR: [gamemodes]\[play]\[addons]\chat\s_chat.lua:125: 'then' expected near ','

[2013-11-10 15:27:37] ERROR: Loading script failed: [gamemodes]\[play]\[addons]\chat\s_chat.lua:125: 'then' expected near ','

ahora me sale esa mierda

Link to comment

Me sigue diciendo que un simbolo esta mal

[2013-11-10 15:51:57] SCRIPT ERROR: [gamemodes]\[play]\[addons]\chat\s_chat.lua:125: unexpected symbol near ','

[2013-11-10 15:51:57] ERROR: Loading script failed: [gamemodes]\[play]\[addons]\chat\s_chat.lua:125: unexpected symbol near ','

function cnnChat(thePlayer, commandName, ...) 
    if ( getPlayerTeam ( thePlayer ) and getTeamName ( getPlayerTeam ( thePlayer) ) == "Reporteros de CNN" ) then 
        local players = getElementsByType("player") 
        local playerName = getPlayerName ( thePlayer ) 
        local chatContent = {...} 
        for index, player in ipairs ( players ) do 
            outputChatBox( "[CNN] ".. playerName.. ": " ..table.concat ( chatContent, " "), player, 196, 255, 255) 
        end 
    else 
        outputChatBox( "No eres de reportero de cnn"), player, 196, 255, 255) 
    end 
end 
addCommandHandler( "sr", cnnChat  

Link to comment
function cnnChat(thePlayer, commandName, ...) 
    if ( getPlayerTeam ( thePlayer ) and getTeamName ( getPlayerTeam ( thePlayer) ) == "Reporteros de CNN" ) then 
        local players = getElementsByType("player") 
        local playerName = getPlayerName ( thePlayer ) 
        local chatContent = {...} 
        for index, player in ipairs ( players ) do 
            outputChatBox( "[CNN] ".. playerName.. ": " ..table.concat ( chatContent ) .. ":", player, 196, 255, 255) 
        end 
    else 
        outputChatBox( "No eres de reportero de cnn", player, 196, 255, 255) 
    end 
end 
addCommandHandler( "sr", cnnChat) 

EDIT: Me falto un parentecis

Link to comment
  • Recently Browsing   0 members

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