• 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!

Command only for Gods

Status
Not open for further replies.

Kayan

Active Member
Joined
Sep 19, 2007
Messages
1,561
Reaction score
38
Location
Santa Catarina
Hello i need this command ony for gods use.

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

Please help x,x
 
add:
if getPlayerGroupId(cid) < GROUP_ID_FOR_GODS_HERE then
return FALSE
end

below:
function onSay(cid, words, param)

and change GROUP_ID_FOR_GODS_HERE.
 
hyhy ;o

Code:
if getPlayerGroupId(cid) < GROUP_ID_FOR_GODS_HERE then
doPlayerSendCancel(cid, "You cannot execute this command")
return FALSE
end
 
The players cannot affect input in the query, so yes, it is safe.
 
Status
Not open for further replies.
Back
Top