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

Action Online Book

jestemPolakiem

New Member
Joined
Oct 17, 2009
Messages
48
Reaction score
2
Location
Poland
Online Book
by jestemPolakiem

script has been tested on The Forgotten Server 0.3.6pl1 and worked

mapaep.png


Code:
[B]To use the script, just use a book.[/B]
Players Online

 » NICKNAME - 0 level, vocation is NONE

data/actions/actions.xml
PHP:
<action itemid="1961" event="buffer" value="
	local string = 'Players Online\n\n'
	for i, pid in ipairs(getPlayersOnline()) do
		string = string .. ' » ' .. getCreatureName(pid) .. ' - ' .. getPlayerLevel(pid) .. ' level, vocation is ' .. getVocationInfo(getPlayerVocation(pid)).name .. '\n'
	end
	doShowTextDialog(cid, 1961, string)
"/>


Greets
jestemPolakiem
 
Last edited:
@Joseph15
Try this
Lua:
<action itemid="1961" event="buffer"><![CDATA[
    local string = 'Players Online\n\n'
    for i, pid in ipairs(getPlayersOnline()) do
        string = string .. ' » ' .. getCreatureName(pid) .. ' - ' .. getPlayerLevel(pid) .. ' level, vocation is ' .. getVocationInfo(getPlayerVocation(pid)).name .. '\n'
    end
    doShowTextDialog(cid, 1961, string)
]]></action>
 
replace this:
Code:
string = string .. ' » ' .. getCreatureName(pid) .. ' - ' .. getPlayerLevel(pid) .. ' level, vocation is ' .. getVocationInfo(getPlayerVocation(pid)).name .. '\n'
With this:
Code:
string = string .. ' » ' .. getCreatureName(pid) .. ' - Level ' .. getPlayerLevel(pid) .. ' , vocation is ' .. getVocationInfo(getPlayerVocation(pid)).name .. '\n'
Why? It looks better to say 'Level 20' than '20 level'.
@Joseph
it doesn't work for you because you are using a server older than 0.3.6
 
for people that are having problems getting it to work I turned it to a
script and here it is:
Lua:
  function onUse(cid, item, toPosition, itemEx, fromPosition)
local string = 'Players Online\n\n'
    for i, pid in ipairs(getPlayersOnline()) do
        string = string .. ' » ' .. getCreatureName(pid) .. ' - Level ' .. getPlayerLevel(pid) .. ', vocation is ' .. getPlayerVocationName(pid) .. '\n'
    end
    doShowTextDialog(cid, 1961, string)
return true
end
and in actions.xml put this:
PHP:
  <action itemid="1961" event="script" value="onlinebook.lua"/>
@jestemPolakiem
nice script!
 
Dear Crimiwei, as though some of you know that famous Unicode (here, we want the UTF-8) sometimes you just can not accept certain characters (used by 'pokemons'). Same error indicates that a character has no characters in the name.
As a compliment?
Just do not block the regular characters - the character names you just a-zA-z0-9 and so
Child's simple, right?
 
I have byn test this script
5/10
- = not fully work small error
+ = like this script
___________________________________

Jesili poczebujesz pomocy PW mi to pomoge jak cosi
 
I have byn test this script
5/10
- = not fully work small error
+ = like this script
___________________________________

Jesili poczebujesz pomocy PW mi to pomoge jak cosi

you suck, what you think does not count here.
 
@Up
I lol'd! But don't be mean to the guy he's just expressing his thoughts?
Yea, much doesn't make sense so it doesn't count! LOL
 
Cant You Make Talk Action?
Lua:
function onSay(cid, words, param, channel)
    local string = 'Players Online\n\n'
    if getWorldCreatures(0) > 0 then
        for i, pid in ipairs(getPlayersOnline()) do
            string = string .. ' » ' .. getCreatureName(pid) .. ' - level ' .. getPlayerLevel(pid) .. ', vocation is ' .. getPlayerVocationName(pid) .. '\n'
        end
        doShowTextDialog(cid, 1961, string)
    end
    return true
end
 
Its good but its still somewhat sucky so not worth it... The online command is much better.
 
Back
Top