depato123 Posted November 10, 2013 Posted November 10, 2013 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
Castillo Posted November 10, 2013 Posted November 10, 2013 if ( getPlayerTeam ( thePlayer ) and getTeamName ( getPlayerTeam ( thePlayer) ) == "Reporteros de CNN" ) Ahi te falta "then" a lo ultimo de la linea.
depato123 Posted November 10, 2013 Author Posted November 10, 2013 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
depato123 Posted November 10, 2013 Author Posted November 10, 2013 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
AlvareZ_ Posted November 10, 2013 Posted November 10, 2013 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
Recommended Posts