Jump to content

Team Data?


.:HyPeX:.

Recommended Posts

Woops.. carefully reading found this in the middle of the BF3_Core_S script.. i didnt remember to add it thought..

  
    function SetTeamValues() 
    local deaths = 0 
    local kills = 0 
    local headshots = 0 
    local score = 0 
    for i,v in ipairs(getPlayersInTeam(ATeam)) do 
    kills = getElementData(v, "Kills") 
    deaths = getElementData(v, "Deaths") 
    headshots = getElementData(v, "Headshots") 
    score = kills * 100 
    end 
    setElementData(ATeam, "Kills","#0046C8Total: "..kills) 
    setElementData(ATeam, "Deaths", "#0046C8Total: "..deaths) 
    setElementData(ATeam, "Headshots", "#0046C8Total: "..headshots) 
    setElementData(ATeam, "Score", "#0046C8Total: "..score) 
    setElementData(ATeam, "FPS", "-") 
    setElementData(ATeam, "Ping", "-") 
    setElementData(ATeam, "Country", "-") 
    end 
    function SetTeamValues2() 
    local deaths = 0 
    local kills = 0 
    local headshots = 0 
    local score = 0 
    for i,v in ipairs(getPlayersInTeam(BTeam)) do 
    local kills = getElementData(v, "Kills") 
    local deaths = getElementData(v, "Deaths") 
    local headshots = getElementData(v, "Headshots") 
    local score = kills * 100 
    end 
    setElementData(BTeam, "Kills", "#0046C8Total: "..kills) 
    setElementData(BTeam, "Deaths", "#0046C8Total: "..deaths) 
    setElementData(BTeam, "Headshots", "#0046C8Total: "..headshots) 
    setElementData(BTeam, "Score", "#0046C8Total: "..score) 
    setElementData(BTeam, "FPS", "-") 
    setElementData(BTeam, "Ping", "-") 
    setElementData(BTeam, "Country", "-") 
    end 
     
    timer = setTimer(SetTeamValues, 1000,0) 
    timer = setTimer(SetTeamValues2, 1000,0) 

Guess its fixed :lol:

Link to comment
I'd do this with tables, which is in my opinion better way. With loops this code would have half of his current lines.

I'll do that once i need to lower down script consuption, and when its ready, for now i prefer easy understading and quick work. Thanks anyways.

Link to comment
I'd do this with tables, which is in my opinion better way. With loops this code would have half of his current lines.

I'll do that once i need to lower down script consuption, and when its ready, for now i prefer easy understading and quick work. Thanks anyways.

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