• 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 Player Information v1.0

Status
Not open for further replies.

Shawak

Intermediate OT User
Joined
Sep 11, 2008
Messages
1,986
Solutions
2
Reaction score
121
Location
Germany
GitHub
Shawak
Author:
33xar8m.jpg


Version: 1.0

This is a very usefull player information script, you can choose what it should cost, or what it shows, and how it shows.
You don't have to visit the website for informations about the player ^_^.
Also tested on TFS 0.3.5pl1.

Screenshot:
(!playerinfo Shawak)
(This Image not inclide Magic Level, Because I fixed it later)

2qcf79y.png


Script:
- data/talkactions/talkactions.xml
LUA:
	<talkaction words="!playerinfo" event="script" value="player_info.lua"/>
- data/talkactions/scripts/player_info.lua
LUA:
--[[
	Player Information Script
	Version 1.0
	By Shawak
]]--


local config = {
	levelToUseCommand = 0,  -- level to use the command
	type = "popup",         -- "Popup" or "Dialog"
	itemForDialog = 1948,   -- Item (works only if u type "Dialoge")
	cost = 0                -- cost to use the command
}

local showing = {
	Skull_HomeTown_Type = "yes",  -- show skull, hometown and type?
	House = "yes",                -- show players house?
	Guild = "yes",                -- Show player guild?
	Skills = "yes"                -- show player skills, mlvl?
}



local settings = { -- Don't Touch This ----------------------
	skulls = {"Yellow", "White", "Red", "Black"},      --
	access = {"Player", "Gamemaster", "CM", "Admin"}   --	
} -----------------------------------------------------------

function onSay(cid, words, param, channel)

	if getPlayerLevel(cid) < config.levelToUseCommand then
		doSendMagicEffect(getCreaturePosition(cid), 2)
		doPlayerSendTextMessage(cid, 26, "You need to be level "..config.levelToUseCommand.." or higher to use this command.")
		return TRUE
	end

	if doPlayerRemoveMoney(cid, config.cost) == FALSE then
		doSendMagicEffect(getCreaturePosition(cid), 2)
		doPlayerSendTextMessage(cid, 26, "You need "..config.cost.." gold coins to use this command.")
		return TRUE
	end

	local pid = getPlayerByNameWildcard(param)

	if isPlayer(pid) == FALSE then
		doPlayerSendCancel(cid, "A player with this name isn't online.")
		doSendMagicEffect(getCreaturePosition(cid), 2)
		return true
	else
		local access, skull, str = "", "", ""
		if getCreatureSkullType(pid) == 0 then
			skull = "None"
		else
			skull = settings.skulls[getCreatureSkullType(pid)]
		end
		if getPlayerGroupId(pid) > #settings.access then
			access = settings.access[#settings.access]
		else
			access = settings.access[getPlayerGroupId(pid)]
		end
		str = str.."Player Information:\n\n• Name: "..getPlayerName(pid).."\n• Status:\n¤ Level: "..getPlayerLevel(pid).."\n¤ Exp: "..getPlayerExperience(pid).."\n¤ Vocation: "..getPlayerVocationName(pid)..""
		if string.lower(showing.Skull_HomeTown_Type) == "yes" then
			str = str.."\n\n¤ Skull: "..skull.."\n¤ Hometown: "..getTownName(getPlayerTown(pid)).."\n¤ Type: "..access..""
		end
		if string.lower(showing.House) == "yes" then
			str = str.."\n\n• House: "..(getHouseByPlayerGUID(getPlayerGUID(pid)) ~= FALSE and getHouseByPlayerGUID(getPlayerGUID(pid)) or "--")..""
		end
		if string.lower(showing.Guild) == "yes" then
			str = str.."\n\n• Guild:\n¤ Name: "..(getPlayerGuildName(pid) ~= "" and getPlayerGuildName(pid) or "--").."\n¤ Rank: "..(getPlayerGuildRank(pid) ~= "" and getPlayerGuildRank(pid) or "--")..""
		end
		str = str.."\n\n• Skills:\n¤ Health: "..getCreatureHealth(pid).."/"..getCreatureMaxHealth(pid).."\n¤ Mana:    "..getCreatureMana(pid).."/"..getCreatureMaxMana(pid).."\n"
		if string.lower(showing.Skills) == "yes" then
			str = str.."\n¤ Magiclvl: "..getPlayerMagLevel(pid).."\n¤ Fist: "..getPlayerSkillLevel(pid, 0).."\n¤ Club: "..getPlayerSkillLevel(pid, 1).."\n¤ Sword: "..getPlayerSkillLevel(pid, 2).."\n¤ Axe: "..getPlayerSkillLevel(pid, 3).."\n¤ Dist: "..getPlayerSkillLevel(pid, 4).."\n¤ Shield: "..getPlayerSkillLevel(pid, 5).."\n¤ Fish: "..getPlayerSkillLevel(pid, 6)..""
		end
		if string.lower(config.type) == "popup" then
			return doPlayerPopupFYI(cid, str)
		elseif string.lower(config.type) == "dialog" then
			return doShowTextDialog(cid, config.itemForDialog, str)
		else
			return print("Invaild type in player_info.lua, you have to type 'Popup' or ' Dialog'.")
		end
	end
	return TRUE
end

I don't tested the whole script, so please report errors/bugs.
@Mock: Please don't by angry with me because I stole your "author pic idea", it's looks so nice ^_^.

Regards,
Shawak
 
Last edited:
uhmm.. i guess i fst edited it when i took a look on the script i saw it is for player info not for staff(gm,cm,etc..)
:)
 
i mean the thread where i posted in it <<but make more>> i edited it in like 15 sec , i thought it is for staff use so i said add more like show acc ,name pass , ip ,etc..
 
i mean the thread where i posted in it <<but make more>> i edited it in like 15 sec , i thought it is for staff use so i said add more like show acc ,name pass , ip ,etc..

Read whole post. <_<
 
I don't like it, because damadgerz like it. :/
 
Status
Not open for further replies.
Back
Top