• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Who can check players with same IP

drosah

New Member
Joined
Aug 16, 2007
Messages
69
Reaction score
0
In the TFS has 2 function

//getIPByName(name)

//getPlayersByIP(ip[, mask = 0xFFFFFFFF])

who working the second ;o and who i create a script that check the players with more than 1 ip (mc check)
 
Code:
--Adam 2008
--Collapser OT

--Adam 2008
--Collapser OT

function onSay(cid, words, param)
	playerlist = "Players Multiclienting:"
	lastest_ip = 0
	online = 0
	dofile("./config.lua")
	env = assert(luasql.mysql())
	con = assert(env:connect(mysqlDatabase, mysqlUser, mysqlPass, mysqlHost, mysqlPort))
	cur = assert(con:execute("SELECT `lastip` FROM `players` WHERE `online` = '1'  Group By lastip Having Count(*) > 1;"))
	row = cur:fetch({}, "a")
	while row do
		players = assert(con:execute("SELECT `name` FROM `players` WHERE `lastip` = "..row.lastip.." and `online` = '1';"))
		prow = players:fetch({}, "a")
		if prow ~= nil then
			while prow do
				if row.lastip == lastest_ip then
					playerlist = playerlist.."\n     "..prow.name
				else
					decip = findIP(row.lastip)
					playerlist = playerlist.."\n\nIP: "..decip.."\n     "..prow.name
					lastest_ip = row.lastip
    				end
				prow = players:fetch (prow, "a")
			end
		end
		row = cur:fetch (row, "a")
	end
	cur:close()

	doShowTextDialog(cid, 1026, playerlist)

end

function findIP(IP)

	local ip=string.format("%X",IP)
	local string1=string.sub(ip,7,8)
	local string2=string.sub(ip,5,6)
	local string3=string.sub(ip,3,4)
	local string4=string.sub(ip,1,2)
	local decip=tonumber(string1, 16).."."..tonumber(string2, 16).."."..tonumber(string3, 16).."."..tonumber(string4, 16)

	return decip
end

this is a talk action for an mc check that i made
the lastip -> to real ip function is kinda messy but gets the job done
 
Last edited:
Back
Top