Darad
New Member
- Joined
- Jun 23, 2009
- Messages
- 119
- Reaction score
- 1
!getplayerinfo paladu~
16:00 Paladude [3458] is a paladin and Paladude has a red skull
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Get player info" version="1.0" author="Darad @ Babylon" enabled="yes">
<config name="gpi_config"><![CDATA[
config = {
vocations = {
[1] = 'sorcerer',
[2] = 'druid',
[3] = 'paladin',
[4] = 'knight',
[5] = 'master sorcerer',
[6] = 'elder druid',
[7] = 'royal paladin',
[8] = 'elite knight'
},
s = {
1,3,4,5
},
skulls = {
[1] = 'yellow skull',
[3] = 'white skull',
[4] = 'red skull',
[5] = 'black skull'
}
}
]]></config>
<talkaction words="!getplayerinfo" event="script"><![CDATA[
domodlib('gpi_config')
local p = getPlayerByNameWildcard(param)
if (not p) then
-- Can't this be solved in another way?! if (p) then does not work :(
else
if isPlayer(p) and getPlayerAccess(p) < 3 then
local name = getPlayerName(p)
local level = getPlayerLevel(p)
local voc = getPlayerVocation(p)
local skullmsg = ''
local skulltype = getCreatureSkullType(p)
if isInArray(config.s, skulltype) then
skullmsg = " and " .. name .. " has a " .. config.skulls[skulltype]
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, name .. " [" .. level .. "] is a " .. config.vocations[voc] .. skullmsg)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN)
return true
end
end
doPlayerSendCancel(cid, 'A player with this name is not online.')
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return true
]]></talkaction>
</mod>
Last edited: