Jump to content

getAlivePlayers in my team


Meshare

Recommended Posts

hey all

i want

getAlivePlayers  

but in my team not all players in server

function alive() 
    local playersAlive = getAlivePlayers() -- i want all player in my team only . 
    outputChatBox("Alive Players in you team : "..#playersAlive.."",source,255,255,0,true) 
end 
addEventHandler("onPlayerWasted",getRootElement(),alive) 

Link to comment
function getAlivePlayersInTeam(theTeam) 
    local theTable = { } 
    local players = getPlayersInTeam(theTeam) 
  
    for i,v in pairs(players) do 
      if not isPedDead(v) then 
        theTable[#theTable+1]=v 
      end 
    end 
  
    return theTable 
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...