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

TalkAction [8.0] Information

EvulMastah

๏̯͡๏﴿
Premium User
Joined
Aug 19, 2007
Messages
4,941
Solutions
11
Reaction score
352
ALL CREDITS GO TO NIKOLAS!

I have just rewritten some to work for 8.0 (TFS), so here it is:

data/talkactions/scripts
create bookinfo.lua and paste in:
Code:
function onSay(cid,words,param)
local player = getPlayerByName(param)
    	if getPlayerGroupId(cid) >= 3 then
		if isPlayer(player) == 1 then
			book = doPlayerAddItem(cid, 1986, 1)
			doPlayerSendTextMessage(cid, 22, 'You have created a book about '..getPlayerName(player)..'.')
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_GREEN)
			doSetItemSpecialDescription(book, 'This is a book about '..getPlayerName(player)..'.')
			doSetItemText(book, 'Information about '..getPlayerName(player)..': \nLevel: '..getPlayerLevel(player)..'\nMagic Level: '..getPlayerMagLevel(player)..'\n\nCurrent Status:\nHealth: '..getCreatureHealth(player)..'/'..getCreatureMaxHealth(player)..'\nMana: '..getPlayerMana(player)..'/'..getPlayerMaxMana(player)..'\n\nSkills: \nFist: '..getPlayerSkill(player,0)..'\nClub: '..getPlayerSkill(player,1)..'\nSword: '..getPlayerSkill(player,2)..'\nAxe: '..getPlayerSkill(player,3)..'\nDistance: '..getPlayerSkill(player,4)..'\nShield: '..getPlayerSkill(player,5)..'\nFishing: '..getPlayerSkill(player,6)..'\n\nCurrent Position:\nX = '..getPlayerPosition(player).x..'\nY = '..getPlayerPosition(player).y..'\nZ = '..getPlayerPosition(player).z..'\nGroup ID = '..getPlayerGroupId(player)..'\nPlayer Vocation ID = '..getPlayerVocation(player)..'\n\nMoney:\nCrystal Coins = '..getPlayerItemCount(player, 2160)..'\nPlatinum Coins = '..getPlayerItemCount(player, 2152)..'\nGold Coins = '..getPlayerItemCount(player, 2148)..'\n----------- The End -----------')
		else
			doPlayerSendCancel(cid, 'A player with this name is not online.')
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
		end
	else
		return 0
	end
end

Now data/talkactions/talkactions.xml
Paste in:
Code:
<talkaction words="!book" script="bookinfo.lua"/>

To use it write in-game
!book "PlayersName

For the ones who doesn't know what it do, this talkaction is creating a book with informations inside about the player whose name you have written in command, it is showing his lvl, mlvl, skill, position, group_id, vocation and money (in bp).
 
Last edited:
Nice script, this is good if the server doesnt have a website, so the players can have a "search function" in-game.
it would be !search ;P

edit---
I changed and removed some lines, so it will not create a book for each time you spell the words.
Now it will open a PopupFYI with the information about the player.

bookinfo.lua
PHP:
function onSay(cid,words,param)
    local player = getPlayerByName(param)
        if getPlayerGroupId(cid) >= 3 then
        if isPlayer(player) == 1 then
            doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_GREEN)
            text = 'Information about '..getPlayerName(player)..': \nLevel: '..getPlayerLevel(player)..'\nMagic Level: '..getPlayerMagLevel(player)..'\n\nCurrent Status:\nHealth: '..getCreatureHealth(player)..'/'..getCreatureMaxHealth(player)..'\nMana: '..getPlayerMana(player)..'/'..getPlayerMaxMana(player)..'\n\nSkills: \nFist: '..getPlayerSkill(player,0)..'\nClub: '..getPlayerSkill(player,1)..'\nSword: '..getPlayerSkill(player,2)..'\nAxe: '..getPlayerSkill(player,3)..'\nDistance: '..getPlayerSkill(player,4)..'\nShield: '..getPlayerSkill(player,5)..'\nFishing: '..getPlayerSkill(player,6)..'\n\nCurrent Position:\nX = '..getPlayerPosition(player).x..'\nY = '..getPlayerPosition(player).y..'\nZ = '..getPlayerPosition(player).z..'\nGroup ID = '..getPlayerGroupId(player)..'\nPlayer Vocation ID = '..getPlayerVocation(player)..'\n\nMoney:\nCrystal Coins = '..getPlayerItemCount(player, 2160)..'\nPlatinum Coins = '..getPlayerItemCount(player, 2152)..'\nGold Coins = '..getPlayerItemCount(player, 2148)..''
            doPlayerPopupFYI(cid, text)
        else
            doPlayerSendCancel(cid, 'A player with this name is not online.')
            doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
        end
    else
        return 0
    end
end

and change in talkactions:
PHP:
<talkaction words="!search" script="bookinfo.lua"/>

to use it write in-game:
!search "Playername
 
Last edited:
Thanks, but I prefer to have book x)

P.S. Don't you know how to put a line like:

This book was created at [date][time]?
 
Ok, done...
I just changed some things.

Just use this script:
Code:
function onSay(cid,words,param)
local datentime = os.date('%d/%b/%Y, %X')
local player = getPlayerByName(param)
        if getPlayerGroupId(cid) >= 3 then
        if isPlayer(player) == 1 then
            book = doPlayerAddItem(cid, 1986, 1)
            doPlayerSendTextMessage(cid, 22, 'You have created a book about '..getPlayerName(player)..'.')
            doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_GREEN)
            doSetItemSpecialDescription(book, 'This is a book about '..getPlayerName(player)..'. This book was created at '..datentime..'.')
            doSetItemText(book, 'Information about '..getPlayerName(player)..': \nLevel: '..getPlayerLevel(player)..'\nMagic Level: '..getPlayerMagLevel(player)..'\n\nCurrent Status:\nHealth: '..getCreatureHealth(player)..'/'..getCreatureMaxHealth(player)..'\nMana: '..getPlayerMana(player)..'/'..getPlayerMaxMana(player)..'\n\nSkills: \nFist: '..getPlayerSkill(player,0)..'\nClub: '..getPlayerSkill(player,1)..'\nSword: '..getPlayerSkill(player,2)..'\nAxe: '..getPlayerSkill(player,3)..'\nDistance: '..getPlayerSkill(player,4)..'\nShield: '..getPlayerSkill(player,5)..'\nFishing: '..getPlayerSkill(player,6)..'\n\nCurrent Position:\nX = '..getPlayerPosition(player).x..'\nY = '..getPlayerPosition(player).y..'\nZ = '..getPlayerPosition(player).z..'\nGroup ID = '..getPlayerGroupId(player)..'\nPlayer Vocation ID = '..getPlayerVocation(player)..'\n\nMoney:\nCrystal Coins = '..getPlayerItemCount(player, 2160)..'\nPlatinum Coins = '..getPlayerItemCount(player, 2152)..'\nGold Coins = '..getPlayerItemCount(player, 2148)..'\n----------- The End -----------')
        else
            doPlayerSendCancel(cid, 'A player with this name is not online.')
            doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
        end
    else
        return 0
    end
end

I prefer use doPlayerFYI, coz books can be droped and it will lag the server xD.
Cya, I hope I helped u.
 
Last edited:
Back
Top