Jump to content

only Teammates can see each other on the map!! HELP


Xwad

Recommended Posts

is it so good?

META:

SERVER.lua

function killTeamFunction ( thePlayer, command, teamName )

-- Find and kill all the players in the team that was specified with the console command

local theTeam = getTeamFromName ( teamName )

if ( theTeam ) then

local players = getPlayersInTeam ( theTeam )

-- Loop through the player table

for playerKey, playerValue in ipairs ( players ) do

-- kill the player

killPlayer ( playerValue )

end

end

end

addCommandHandler ( "killTeam", killTeamFunction )

CLIENT.lua

function showTeamFunction ( command, teamName )

-- Find and show all the players in the team that was specified with the console command

local theTeam = getTeamFromName ( teamName )

if ( theTeam ) then

local players = getPlayersInTeam ( theTeam )

-- Loop through the player table

for playerKey, playerValue in ipairs ( players ) do

outputChatBox ( getPlayerName(playerValue) )

end

end

end

addCommandHandler ( "showTeam", showTeamFunction )

Link to comment

is it so good?:D

  
-- get a table with all teams 
local allTeams = getElementsByType ( "team" ) 
-- for every team, 
addEventHandler("onResourceStart", resourceRoot, 
function () 
for index, theTeam in ipairs(allTeams) do 
    -- if friendly fire is off, 
    if ( getTeamFriendlyFire ( theTeam ) == false ) then 
        -- switch it on 
        setTeamFriendlyFire ( theTeam, true ) 
    end 
end) 
  

Link to comment
  
function showTeamFunction ( command, teamName ) 
-- Find and show all the players in the team that was specified with the console command 
local theTeam = getTeamFromName ( teamName ) 
if ( theTeam ) then 
local players = getPlayersInTeam ( theTeam )  
-- Loop through the player table 
for playerKey, playerValue in ipairs ( players ) do 
outputChatBox ( getPlayerName(playerValue) ) 
end 
end 
end 
  

??

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...