Jump to content

[HELP] Lock on specific team...


lolman

Recommended Posts

Hello,

I need help with my script...

I want to countPlayers in a specific team like "Criminals" team. The current script counts every team of the player like, if you are in civilians it counts the players in that team. But I want to lock it only for Criminals...

here's my code :

function count() 
    local ge = getPlayerTeam(getLocalPlayer()) 
  
    local countt = countPlayersInTeam(ge) 
     
    dxDrawText(countt, SX*1.295, SY*0.365, SX*0.38, SY*0.5, tocolor(255, 255, 255, 255), 2.00, "bankgothic", "center", "center", false, false, true, false, false) 
end 

help is needed guys...

Link to comment

I was clear enough to tell my problem... but for you I'll try to explain my problem better.

You see DxDrawText? That shows the amount of players in a team (for now, every team you are in) but I want it like that it only counts the players of the team called "Criminals". Now it counts the players in the team which you are in it, but I want that it has to count the players in the team criminals.

Link to comment
  • Moderators
function count() 
    local ge = getPlayerTeam(getLocalPlayer()) 
    if ge and getTeamName(ge) == "Criminals" then 
      dxDrawText(countPlayersInTeam(ge), SX*1.295, SY*0.365, SX*0.38, SY*0.5, tocolor(255, 255, 255, 255), 2.00, "bankgothic", "center", "center", false, false, true) 
    end 
end 

Link to comment

Thank you DNL for your help.

And how can I make something which sets the text of it "0" when there aren't players in that team?

dxDrawText(countPlayersInTeam(ge), SX*1.295, SY*0.365, SX*0.38, SY*0.5, tocolor(255, 255, 255, 255), 2.00, "bankgothic", "center", "center", false, false, true) 
    elseif (countPlayersInTeam(ge) <= 0) then 
    dxDrawText("0", SX*1.295, SY*0.365, SX*0.38, SY*0.5, tocolor(255, 255, 255, 255), 2.00, "bankgothic", "center", "center", false, false, true) 

Link to comment

:D

  
function count() 
    local ge = getPlayerTeam(getLocalPlayer()) 
    if ge and getTeamName(ge) == "Criminals" then 
        if countPlayersInTeam(ge) <= 0 then 
        dxDrawText(0, SX*1.295, SY*0.365, SX*0.38, SY*0.5, tocolor(255, 255, 255, 255), 2.00, "bankgothic", "center", "center", false, false, true) 
        else 
        dxDrawText(countPlayersInTeam(ge), SX*1.295, SY*0.365, SX*0.38, SY*0.5, tocolor(255, 255, 255, 255), 2.00, "bankgothic", "center", "center", false, false, true) 
        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...