lolman Posted June 25, 2015 Share Posted June 25, 2015 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
KariiiM Posted June 25, 2015 Share Posted June 25, 2015 I didn't understand what do you want to do exactly Link to comment
lolman Posted June 25, 2015 Author Share Posted June 25, 2015 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
DNL291 Posted June 25, 2015 Share Posted June 25, 2015 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
KariiiM Posted June 25, 2015 Share Posted June 25, 2015 Anyway DNL already solved your problem, try to check this example in wiki it will help you in future https://wiki.multitheftauto.com/wiki/CountPlayersInTeam Link to comment
lolman Posted June 25, 2015 Author Share Posted June 25, 2015 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
iMr.Dawix~# Posted June 25, 2015 Share Posted June 25, 2015 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now