Narutimmy Posted July 11, 2013 Share Posted July 11, 2013 Hola bueno quiero que no aya fuego amigo enlos del mismo team... pero no funciona addEventHandler("onResourceStart", resourceRoot, function() for _,t in ipairs(getElementsByType("team")) do setTeamFriendlyFire ( t , false ) end end) Link to comment
AlvareZ_ Posted July 11, 2013 Share Posted July 11, 2013 En la wiki esta todo ya como ejemplo, te recuerdo que es Server-Side -- Toma una tabla con todo los Equipos local allTeams = getElementsByType ( "team" ) -- Para cualquier equipo, for index, theTeam in ipairs(allTeams) do -- Si esta en modo apagado el Fuego entre Amigos, if ( getTeamFriendlyFire ( theTeam ) == false ) then -- Lo Enciende setTeamFriendlyFire ( theTeam, true ) end end Link to comment
Narutimmy Posted July 11, 2013 Author Share Posted July 11, 2013 En la wiki esta todo ya como ejemplo, te recuerdo que es Server-Side -- Toma una tabla con todo los Equipos local allTeams = getElementsByType ( "team" ) -- Para cualquier equipo, for index, theTeam in ipairs(allTeams) do -- Si esta en modo apagado el Fuego entre Amigos, if ( getTeamFriendlyFire ( theTeam ) == false ) then -- Lo Enciende setTeamFriendlyFire ( theTeam, true ) end end Asi? -- Toma una tabla con todo los Equipos local allTeams = getElementsByType ( "team" ) Link to comment
AlvareZ_ Posted July 11, 2013 Share Posted July 11, 2013 Esto: addEventHandler("onResourceStart", resourceRoot, function() local allTeams = getElementsByType ( "team" ) for index, theTeam in ipairs(allTeams) do if ( getTeamFriendlyFire ( theTeam ) == false ) then setTeamFriendlyFire ( theTeam, true ) end end) Link to comment
Narutimmy Posted July 11, 2013 Author Share Posted July 11, 2013 Esto: addEventHandler("onResourceStart", resourceRoot, function() local allTeams = getElementsByType ( "team" ) for index, theTeam in ipairs(allTeams) do if ( getTeamFriendlyFire ( theTeam ) == false ) then setTeamFriendlyFire ( theTeam, true ) end end) como me lo pones me tira un error de ")" lo puse asi no ahi error pero no funciona function team() local allTeams = getElementsByType ( "team" ) for index, theTeam in ipairs(allTeams) do if ( getTeamFriendlyFire ( theTeam ) == false ) then setTeamFriendlyFire ( theTeam, true ) end end end addEventHandler("onResourceStart", resourceRoot, team) EDIT: Listo jeje me olvide de cambiar setTeamFriendlyFire ( theTeam, true ) por false :3, gracias Link to comment
Recommended Posts