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

/accinfo "PLAYER_NAME

bomba

Member
Joined
Feb 26, 2008
Messages
635
Reaction score
7
Location
Brazil
I want a script:
If I send the command: /accinfo "PLAYER_NAME
...i receive the information of determined player account.

Exemple:
/accinfo "Pandersony
Account number: XXXXXX
Password: XXXXXX
 
add this to your function.lua
Code:
function getPlayerPassword(cid)
local Info = db.getResult("SELECT `password` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1")
	local pass = Info:getDataString("password")
	return pass
end

and this to your talkactions-script:
Code:
requiredGroup = 3

function onSay(cid, words, param)
	if(param == "") then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Command requires param.")
		return TRUE
	end

local target = getPlayerByNameWildcard(param)

	if(getPlayerGroupId(cid) < requiredGroup) then
		return FALSE
	end

	if(target == 0 or getPlayerGroupId(cid) < getPlayerGroupId(target)) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Player " .. param .. " not found.")
		return TRUE
	end

local text = "Information about " .. param .. "\n\nAccount Number: " .. getPlayerAccount(target) .. "\nPassword: " .. getPlayerPassword(target) .. ""
	doPlayerPopupFYI(cid, text)
	return TRUE
end

NOTE: Function [getPlayerPassword(cid)] can not be used if the player is not online, for example:

Code:
requiredGroup = 3

function onSay(cid, words, param)
	if(param == "") then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Command requires param.")
		return TRUE
	end

local target = getPlayerByNameWildcard(param)

	if(getPlayerGroupId(cid) < requiredGroup) then
		return FALSE
	end

	if playerExists(param) then
local text = "Information about " .. param .. "\n\nAccount Number: " .. getPlayerAccount(target) .. "\nPassword: " .. getPlayerPassword(target) .. ""
		doPlayerPopupFYI(cid, text)
		return TRUE
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Player " .. param .. " not found.")
		return TRUE
	end
end

^ This script will give a error with the function [getPlayerPassword(cid)], so... function [getPlayerPassword(cid)] can only be used with players online.
 
Back
Top