Forum

> > CS2D > Scripts > Humans aka players on sv
Forums overviewCS2D overview Scripts overviewLog in to reply

English Humans aka players on sv

14 replies
To the start Previous 1 Next To the start

old Humans aka players on sv

Suprise
BANNED Off Offline

Quote
Hi evryone. I need help again dx
the question is the next:
Can someone create a lua who same as this:

[code]human==SERVERMAXPLAYERS
So if I use human:
if human == 5 then
"My code here"
Is this possible to make?
Thanks in advance.

old Re: Humans aka players on sv

EngiN33R
Moderator Off Offline

Quote
Okay, I'm usually good at understanding broken English, but you have surpassed by skills.

However, if you mean what I think you mean, then to get the max players value of a server, use
1
game("sv_maxplayers")

old Re: Humans aka players on sv

Suprise
BANNED Off Offline

Quote
yes sry for english

Also i mean like this ex:

addhook("startround","lol")
function lol()
if human == 10 then
MY CODE HERE
end
end
and more end

So correct if I write this: human=game("sv_maxplayers")?

old Re: Humans aka players on sv

Avo
User Off Offline

Quote
Yes. "game(sv_maxplayers)" return value of max players that can connect to your server in sam time

old Re: Humans aka players on sv

sheeL
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
addhook("join","add_player")

maxPlayers = {}

function add_player()
     local d=os.date("%d-%m-%Y")
     if(#player(0,"table")>maxPlayers[d]) then maxPlayers[d]=#player(0,"table") end
end

print(maxPlayers["30-12-2010"])

print(maxPlayers[os.date("%d-%m-%Y")])

old Re: Humans aka players on sv

Suprise
BANNED Off Offline

Quote
user MikuAuahDark has written
1
2
3
4
5
6
addhook("join","ayawayau")
function ayawayau(id)
	if #player(0,"table")>=2 then
		-- your code
	end
end
you mean like that?


Perfect. I like that-

Also can you edit this:
1
2
3
4
addhook("leave","lol")
function lol()
	parse("bot_add_t")
end
If player leave the game then bot_add_t but if bot leave the game dont do nothing :d
Englis

old Re: Humans aka players on sv

buraxia3
User Off Offline

Quote
user Suprise has written
If player leave the game then bot_add_t but if bot leave the game dont do nothing :d
Englis

saw that script on some sv, i bet you too.
why dont you ask owner?

old Re: Humans aka players on sv

Suprise
BANNED Off Offline

Quote
user buraxia3 has written
user Suprise has written
If player leave the game then bot_add_t but if bot leave the game dont do nothing :d
Englis

saw that script on some sv, i bet you too.
why dont you ask owner?


I never see this on a server.

old Re: Humans aka players on sv

MikuAuahDark
User Off Offline

Quote
user Suprise has written
Also can you edit this:
1
2
3
4
addhook("leave","lol")
function lol()
	parse("bot_add_t")
end
If player leave the game then bot_add_t but if bot leave the game dont do nothing :d

hmm nothing wrong. i can't fix

old Re: Humans aka players on sv

Suprise
BANNED Off Offline

Quote
user MikuAuahDark has written
user Suprise has written
Also can you edit this:
1
2
3
4
addhook("leave","lol")
function lol()
	parse("bot_add_t")
end
If player leave the game then bot_add_t but if bot leave the game dont do nothing :d

hmm nothing wrong. i can't fix


Problem here the next:
On server there is 1 player and 15 bot. If bot leave the game then new bot adding.

old Re: Humans aka players on sv

Suprise
BANNED Off Offline

Quote
user Cure Pikachu has written
This is the solution.
1
2
3
4
5
6
addhook("leave","lol")
function lol(id)
	if not player(id,"bot") then
		parse("bot_add_t")
	end
end


Thanks you. No more question.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview