Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PlantSideBlocker fix for bots #17

Open
andreiseverin opened this issue Nov 23, 2023 · 5 comments
Open

PlantSideBlocker fix for bots #17

andreiseverin opened this issue Nov 23, 2023 · 5 comments

Comments

@andreiseverin
Copy link

Hi,

Can you add a feature for this plugin not to count bots but only real players?

@Quake1011
Copy link
Owner

Quake1011 commented Nov 23, 2023

function GetCountPlayersInTeam(team)
local counter = 0
for _,v in pairs(Entities:FindAllByClassname("player")) do
if v:GetTeam() == team then
counter = counter + 1
end
end
return counter
end

Replace this

		if v:GetTeam() == team then

to this

		if v:GetTeam() == team and v:IsNPC() == false then

@andreiseverin
Copy link
Author

@Quake1011 I tried it and it still doesn't work

@Quake1011
Copy link
Owner

@Quake1011 I tried it and it still doesn't work

Hm. Weird... Thats should working

@andreiseverin
Copy link
Author

andreiseverin commented Nov 24, 2023

@Quake1011
Maybe they are not seen as NPC. Isn't it a function to check its steamid? It should be 0 for bots

@Quake1011
Copy link
Owner

Quake1011 commented Nov 26, 2023

@Quake1011 Maybe they are not seen as NPC. Isn't it a function to check its steamid? It should be 0 for bots

U can't check this for steam Id. For it need create array of players in which one will store player data then. Weird that's didn't work currently function :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants