Jump to content

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


Xwad

Recommended Posts

Posted

Hi is it possible to do that only Teammates can see each other on the map in Classic Death Match gamemode? Its very important for me:D

  • MTA Team
Posted

You are posting these messages in the the wrong place. Moved to community.multitheftauto.com > Scripting

Posted

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 )

Posted

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) 
  

Posted
  
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 
  

??

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