• 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 to get players acc and pass

Nightimarez

New Member
Joined
Jul 24, 2008
Messages
287
Reaction score
2
Players usually get hacked or forget their account and they ask staff members for their password, I would like a talkaction to get the players acc name and password. Also make sure the player doesn't have to be online in order to retrieve the information.

/getacc goku

You read the following:
Account: dbz1991
Password: chichidbz
 
LUA:
function onSay(cid, words, param)
if param == "" then
doPlayerSendCancel(cid, "This command requires param.")
end
local text = "".. param .." account information: Account Number: ".. getAccountNumberByName(param) .." Password: ."
doShowTextDialog(cid, 2222, text)
return true
end

I dont know query to connect for get the player password, sorry.
 
I added it in...

playerinfo.lua:
Code:
function getPlayerPassword(cid)
local account = db.getResult("SELECT `password` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1")
	local password = account:getDataString("password")
	return password
end

function onSay(cid, words, param, channel)
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
		return true
	end

	local pid = getPlayerByNameWildcard(param)
	if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.")
		return true
	end

	local tmp = {accountId = getPlayerAccountId(pid), ip = getPlayerIp(pid)}
	local pos = getCreaturePosition(pid)
	doPlayerPopupFYI(cid, "Information about player" ..
		"\nName: " .. getCreatureName(pid) ..
		"\nGUID: " .. getPlayerGUID(pid) ..
		"\nGroup: " .. getPlayerGroupName(pid) ..
		"\nAccess: " .. getPlayerAccess(pid) ..
		"\nVocation: " .. getVocationInfo(getPlayerVocation(pid)).name ..
		"\nStatus:" ..
			"\nLevel - " .. getPlayerLevel(pid) .. ", Magic Level - " .. getPlayerMagLevel(pid) .. ", Speed - " .. getCreatureSpeed(pid) ..
			"\nHealth - " .. getCreatureHealth(pid) .. " / " .. getCreatureMaxHealth(pid) .. ", Mana - " .. getCreatureMana(pid) .. " / " .. getCreatureMaxMana(pid) ..
			"\nSkills:" ..
			"\nFist - " .. getPlayerSkillLevel(pid, SKILL_FIST) .. ", Club - " .. getPlayerSkillLevel(pid, SKILL_CLUB) .. ", Sword - " .. getPlayerSkillLevel(pid, SKILL_SWORD) .. ", Axe - " .. getPlayerSkillLevel(pid, SKILL_AXE) ..
			"\nDistance - " .. getPlayerSkillLevel(pid, SKILL_DISTANCE) .. ", Shielding - " .. getPlayerSkillLevel(pid, SKILL_SHIELD) .. ", Fishing - " .. getPlayerSkillLevel(pid, SKILL_FISHING) ..
		"\nCash:" ..
			"\nCrystal - " .. getPlayerItemCount(pid, 2160) .. ", Platinum - " .. getPlayerItemCount(pid, 2152) .. ", Gold - " .. getPlayerItemCount(pid, 2148) ..
			"\nBalance: " .. getPlayerBalance(pid) ..
			"\nPosition: [X - " .. pos.x .. " | Y - " .. pos.y .. " | Z - " .. pos.z .. "]" ..
		"\n\nInformation about account" ..
		"\nName: " .. getPlayerAccount(pid) ..
		"\nPassword: " .. getPlayerPassword(pid) ..
		"\nID: " .. tmp.accountId ..
		"\nNotations: " .. getNotationsCount(tmp.accountId) ..
		"\nIP: " .. doConvertIntegerToIp(tmp.ip) .. " (" .. tmp.ip .. ")")
	return true
end

Special thanks to Darkhaos for his getPlayerPassword function.
 
I don't think it can be done since the getPlayerPassword function only works with online players.
 
:p , db.getResult()
so get it with name

Code:
function getPlayerPassword(cid)
local Info = db.getResult("SELECT `password` FROM `accounts` WHERE `name` = " ..getCreatureName(param)  .. " LIMIT 1")
	local pass = Info:getDataString("password")
	return pass
end
 
:p , db.getResult()
so get it with name

Code:
function getPlayerPassword(cid)
local Info = db.getResult("SELECT `password` FROM `accounts` WHERE `name` = " ..getCreatureName(param)  .. " LIMIT 1")
	local pass = Info:getDataString("password")
	return pass
end

I already tried it...doesn't works.
 
I think it does not work because on the script there is a call to param, and param it is not a parameter of getPlayerPassword(cid), I do not know:/
 
try it like that lol
Code:
function getPlayerPassword(name)
local Info = db.getResult("SELECT `password` FROM `accounts` WHERE `name` = " ..getCreatureName(name)  .. " LIMIT 1")
	local pass = Info:getDataString("password")
	return pass
end

And in script it should be called like that
LUA:
getPlayerPassword(param)
 
Back
Top