Forum

> > CS2D > Scripts > No same ip at one server.
Forums overviewCS2D overview Scripts overviewLog in to reply

English No same ip at one server.

6 replies
To the start Previous 1 Next To the start

old No same ip at one server.

PowerSpeed
User Off Offline

Quote
Hello Guys.

I need a little lua who allow the player not to join the server 2 times with the same ip.

I need something like that because they can make money in roleplay server.
I will not explain how.

Can someone help me pls.

old Re: No same ip at one server.

mafia_man
User Off Offline

Quote
This is not enought, cuz It's still possible to duplicate money on your rp server. Better if you don't allow to login twice to the same usgn.

And this is how it was possible to cheat money on your server:
(Player 1 and Player 2 uses the same usgn)
File save money = 1000$;
Player 1 Joins (1000$)
Player 2 Joins (1000$)
Player 1 Drops 1000$ (0$)
Player 2 Pickups (2000$)
Player 1 Disconnected (0$ is written to save file)
Player 2 Disconnected (0$ is overitten by 2000$ to save file)

And repeats this until he got enough money.

But you think not allowing to join with same ip is enough.
But you're wrong it's not. Somebody can give his password to his friend and they can work both.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
addhook("join", "usgnJoinCheck");
function usgnJoinCheck(id)
	local usgn = player(id, "usgn");
	if usgn <= 0 then return 0 end;
	
	local _, i, iusgn;
	for _, i in pairs(player(0, "table")) do
		iusgn = player(i, "usgn");
		if iusgn == usgn then
			parse('kick '.. id);
			parse('kick '.. i);
			msg("Kicking ".. player(id, "name") .. " and ".. player(i, "name") .." Reason: Double usgn detected!");
			return 0;
		end
	end
end
edited 1×, last 05.07.12 11:33:09 pm

old Re: No same ip at one server.

Apache uwu
User Off Offline

Quote
That's very dangerous, a better option would be to kick both of the players that have the same USID (not same IP).

The reason is because, if the player's client accidentally crashes, they can't rejoin the server until the first client is kicked -- which could take longer than you would think.

The only downside to kicking both usids would be that if your friend with your usgn account password (which is illegal read the rules), joins you will be kicked.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview