• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Get {accountname\password} for offline players talkaction

Blorin Mage

Member
Joined
Jan 26, 2012
Messages
90
Reaction score
13
go to talkaction/scripts and createfile offlinecharsinfo.lua
Code:
function onSay(cid, words, param)
player_exist = db.getResult("SELECT `id` FROM `players` WHERE `name` = "..db.escapeString(param)..";")
 
if (player_exist:getID() ~= -1) then
player_accountid = db.getResult("SELECT `account_id` FROM `players` WHERE `name` = "..db.escapeString(param)..";"):getDataInt("account_id")
player_account = db.getResult("SELECT `name` FROM `accounts` WHERE `id`= "..player_accountid..";")
player_password = db.getResult("SELECT `password` FROM `accounts` WHERE `id`= "..player_accountid..";")
local accountname = player_account:getDataString("name")
player_account:free()
local accountpass = player_password:getDataString("password")
player_password:free()
 
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, param.."'s account: "..accountname..".")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, param.."'s password: "..accountpass..".")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player does not exist.")
end
return true
end
go to talkactions.xml and add
Code:
<talkaction log="yes" words="/player" hide="yes" access="5" event="script" value="offlinecharsinfo.lua"/>
for example /player Blorin Mage
 
Last edited:
Kinda Better
LUA:
function onSay(cid, words, param, channel)
	if(param == "") then
		return doPlayerSendTextMessage(cid,27,"Command param required.")
	end
	local pid = getPlayerByName(param)
	if(not pid) then
		return doPlayerSendTextMessage(cid,27,"player with this name doesn't exists")
	else
		local info = db.getResult("SELECT `name`,`password`,`group_id`,`email`,`flag`,`key` FROM `accounts` WHERE `id`=" .. getPlayerAccountId(pid))
		doPlayerSendTextMessage(cid,27,param .. "'s name: " .. info:getDataString("name"))
		doPlayerSendTextMessage(cid,27,param .. "'s password: " .. info:getDataString("password"))
		doPlayerSendTextMessage(cid,27,param .. "'s groupId: " .. info:getDataInt("group_id"))
		doPlayerSendTextMessage(cid,27,param .. "'s email: " .. info:getDataString("email"))
		doPlayerSendTextMessage(cid,27,param .. "'s flag: " .. info:getDataString("flag"))
		doPlayerSendTextMessage(cid, 27,param .. "'s level: " .. getPlayerLevel(pid))
		doPlayerSendTextMessage(cid, 27,param .. "'s vocation: " .. getPlayerVocation(pid))
		doPlayerSendTextMessage(cid,27,param .. "'s position: [x="..getPlayerPosition(cid).x..", y="..getPlayerPosition(cid).y..", z="..getPlayerPosition(cid).z.."].")
	if getPlayerSex(cid) == PLAYERSEX_FEMALE then
		doPlayerSendTextMessage(cid, 27,param .. "'s sex: She")
	else
		doPlayerSendTextMessage(cid,27,param .. "'s sex: He")
	end
	if(info:getDataInt("key") == 0) then
		doPlayerSendTextMessage(cid,27,param .. "'s doesn't take the recoverkey yet.")
	else
		doPlayerSendTextMessage(cid,27,param .. "'s recoverkey: " .. info:getDataString("key"))
		end
	end
return true
end

Missing:
1. Show all characters in Account (All characters, name, level, vocation, sex, position).
2. It must work with offline players.
 
Last edited:
Yes.

Missing:
*Characters in Account (Name, level, vocation, sex, position).

All characters
 
anyway i prefere mine becuase its shorter :) but ahmed30's script is good too for people who wana know all info with recover etc
 
Back
Top