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

Simple and useful talkaction requested. Acc/pass (offline player)

R

Rozinx

Guest
Well, while I try to do this by myself, if someone has that already done, post it please.


All I request is : something like /accpass "Playername

And it will show its account and password.
Don't wanna ask too much, but if possible, i'd like it to show Recovery key too.


I really need this script, I'm tired of having to connect to my database everytime someone loses their acc or password and the rk won't work

Thanks in advance, I'm still trying it by myself, if I'm able to do that I'll post it.
 
Made it 8D
Tested with TFS 0.3.6!(I Think it works with any LuaSQL server)

Here, getaccount.lua in talkactions/scripts:
Lua:
---- Get player account/password by Nandonalt

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

And talkactions.xml:
Code:
 <talkaction log="yes" words="/account" access="5" event="script" value="getaccount.lua"/>

Just say "/account Name" and:
"01:54 /account Sim
01:54 Sim's account: 435623.
01:54 Sim's password: yutwrd."
 
Pop Up Message

Code:
function onSay(cid, words, param, channel)
local AccCheck = db.getResult("SELECT `id` FROM `players` WHERE `name` = "..db.escapeString(param)..";")
local AccName = db.getResult("SELECT `name` FROM `accounts` WHERE `id`= ".. getPlayerGUID ..";")
local AccPass = db.getResult("SELECT `password` FROM `accounts` WHERE `id`= ".. getPlayerGUID ..";")
	if (AccCheck:getID() == 1) then
		local Account = AccName:getDataString("name")
			AccName:free()
		local Password = AccPass:getDataString("password")
			AccPass:free()
		doPlayerPopupFYI(cid, "Account Information of Player ".. getCreatureName(param) .." \n\nAccount Name: ".. Account .." \nAccount Password: ".. Password .."" )
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This player does not exist.")
	end
	return true
end
 
Thanks guys ! I love ya lol.
I'm trying to adapt it to recovery key too, thanks very much!
Lua:
--- Get player account/password by Nandonalt

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..";")
player_key = db.getResult("SELECT `key` FROM `accounts` WHERE `id`= 

"..player_key..";")
local accountname = player_account:getDataString("name")
player_account:free()
local accountpass = player_password:getDataString("password")
player_password:free()
local accountkey = player_key:getDataString("key")
player_key:free()

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, param.."'s 

account: "..accountname..".")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, param.."'s 

password: "..accountpass..".")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, param.."'s 

key: "..accountkey..".")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player does 

not exist.")
end
return true
end
i'm trying this , but there's something wrong
 
Last edited by a moderator:
Change:
Lua:
player_key = db.getResult("SELECT `key` FROM `accounts` WHERE `id`=
"..player_key..";")
To:
Lua:
player_key = db.getResult("SELECT `key` FROM `accounts` WHERE `id`=
"..player_accountid..";")
 
[28/12/2009 02:38:16] data/lib/database.lua:76: [Result:getDataString] Result not set!
[28/12/2009 02:38:16] stack traceback:
[28/12/2009 02:38:16] [C]: in function 'error'
[28/12/2009 02:38:16] data/lib/database.lua:76: in function 'getDataString'
[28/12/2009 02:38:16] data/talkactions/scripts/accpass.lua:16: in function <data/talkactions/scripts/accpass.lua:3>

I can't figure out why Lol
Thanks for the help guys. Do not waste your time with me if it's too much work.
 
Back
Top