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

Lua Request of a command

Exmerus

New Member
Joined
Jan 14, 2008
Messages
306
Reaction score
3
I need a command to know the account nama, password and character name of a player by using it's player ID.
For Example:

/ninfo 123

Character name: Exmerus
Account: 123456
Password: 654321

Someone have any idea of how to do it? Or can do it for me for free?
 
there could probably be an easier way to write this up, but I've managed to do it this way:

works without the player online ;)

Lua:
function onSay(cid, words, param, channel)
    if param == '' then
        return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
    end
	
    if not(getPlayerNameByGUID(param)) or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid)) then
        return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.")
    end
	
	local player_result = db.getResult("SELECT * FROM `players` WHERE `id` = ".. param ..";")
	local accountID = player_result:getDataInt("account_id")
	local playerName = player_result:getDataString("name")
	
	local account_result = db.getResult("SELECT * FROM `accounts` WHERE `id` = ".. accountID ..";")
	local accountName = account_result:getDataString("name")
	local pass = account_result:getDataString("password")
	
	doPlayerPopupFYI(cid, "\nCharacter: " .. playerName ..
		"\n\nAccount: " .. accountName ..
		"\nPassword: " .. pass)
		
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nCharacter: " .. playerName ..
		"\n\nAccount: " .. accountName ..
		"\nPassword: " .. pass)
	return true
end

Lua:
<talkaction log="yes" access="5" words="/ninfo" event="script" value="playeraccdetails.lua"/>

o8cw3c.png
 
Last edited:
Back
Top