• 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 Online List | !online | in Book

Zerak

http://otstatus.com/
Joined
Oct 4, 2009
Messages
1,126
Reaction score
48
Location
Sweden
all you have to do is,

change the file which is located on:
***/data/talkactions/scripts/online.lua

open it.

remove all the text and add this text:
Code:
local config = {
	showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand'))
}

function onSay(cid, words, param, channel)
	local players = getPlayersOnline()
	local strings = {""}

	local i, position = 1, 1
	local added = false
	for _, pid in ipairs(players) do
		if(added) then
			if(i > (position * 7)) then
				strings[position] = strings[position] .. ","
				position = position + 1
				strings[position] = ""
			else
				strings[position] = i == 1 and "" or strings[position] .. ", "
			end
		end

		if((config.showGamemasters or getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES) or not getPlayerCustomFlagValue(pid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) and (not isPlayerGhost(pid) or getPlayerGhostAccess(cid) >= getPlayerGhostAccess(pid))) then
			strings[position] = strings[position] .. getCreatureName(pid) .. " [" .. getPlayerLevel(pid) .. "]"
			i = i + 1
			added = true
		else
			added = false
		end
	end
	
	for i, str in ipairs(strings) do
		if(str:sub(str:len()) ~= ",") then
			str = str .. "\n"
		end

	doShowTextDialog(cid, 1952, str)
	end

	return true
end

pic:
bg8svb.png


How to change the image on the book?
change on line 36.
Code:
	doShowTextDialog(cid, ITEM ID, str)

It works to change it to all items you want, it isn't only book/paper.


REP?
 
... this is much better than for action.. this one is from the spellbook script.. i just changed the show up text into a book with text. and fixed it a bit.
 
How i can do it one player per line?

Something like


Player 1
Player 2
Player 3
Player 4

Total: 4


Understand?

Edit.

omg, i done it o.o im fckin happy o.o !!
 
Last edited:
i fixed it after i reasleseD;)

Code:
local config = {
	showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand'))
}

function onSay(cid, words, param, channel)
	local players = getPlayersOnline()
	local strings = {""}

	local i, position = 1, 1
	local added = false
	for _, pid in ipairs(players) do
		if(added) then
			if(i > (position * 7)) then
				strings[position] = strings[position] .. ","
				position = position + 1
				strings[position] = ""
			else
				strings[position] = i == 1 and "" or strings[position] .. ", "
			end
		end

		if((config.showGamemasters or getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES) or not getPlayerCustomFlagValue(pid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) and (not isPlayerGhost(pid) or getPlayerGhostAccess(cid) >= getPlayerGhostAccess(pid))) then
			strings[position] = strings[position] .. getCreatureName(pid) .. " [" .. getPlayerLevel(pid) .. "]"
			i = i + 1
			added = true
		else
			added = false
		end
	end
	
	for i, str in ipairs(strings) do
		if(str:sub(str:len()) ~= "\n") then
			str = str .. "."
		end

	doShowTextDialog(cid, 1952, str)
	end

	return true
end
 
if u dont know why u cant delet words in !online commands try this

local config = {
showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand'))
}

function onSay(cid, words, param, channel)
local players = getPlayersOnline()
local strings = {""}

local i, position = 1, 1
local added = false
for _, pid in ipairs(players) do
if(added) then
if(i > (position * 7)) then
strings[position] = strings[position] .. ","
position = position + 1
strings[position] = ""
else
strings[position] = i == 1 and "" or strings[position] .. ", "
end
end

if((config.showGamemasters or getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES) or not getPlayerCustomFlagValue(pid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) and (not isPlayerGhost(pid) or getPlayerGhostAccess(cid) >= getPlayerGhostAccess(pid))) then
strings[position] = strings[position] .. getCreatureName(pid) .. " [" .. getPlayerLevel(pid) .. "]"
i = i + 1
added = true
else
added = false
end
end

for i, str in ipairs(strings) do
if(str:sub(str:len()) ~= "\n") then
str = str .. "."
end

doShowTextDialog(cid, 1950, str)
end

return true
end
 
Lua:
function onSay(cid, words, param, channel)
	local str,count = "",0
	for _, cid in ipairs(getPlayersOnline()) do
		if getPlayerAccess(cid) < 3 then
		  count = count + 1
                  str = str.."".. (str == "" and "" or ",") ..""..getPlayerName(cid).."["..getPlayerLevel(cid).."]"
                 end
                 end
	return doShowTextDialog(cid, 1952, count.." player(s) online:\n\n"..str)
end
 
Code:
local show_staff = true --false to not show them, if false you can ingore show_staff_players --
local staff_groupid = 2 --Shows account with PLAYER GROUPID 2 and under.

local array_books = {1976, 1979, 1982} --Pick different books to show when player uses command. --
local array_amount = 3 --how many itemid's you have in array_books --

function onSay(player, words, param)

local text = "[PLAYERS ONLINE]\n"

players = Game.getPlayers()
local count = 0

for i = 1, #players do
    if players[i]:getName() ~= player:getName() and players[i]:getGroup():getId() <= 1 then
        text = text..""..players[i]:getName().." - lvl: ("..players[i]:getLevel()..")      voc: ("..players[i]:getVocation():getName()..")\n"
    else
    text = text
end
count = count + 1
end

if show_staff then
text = text.."\n[STAFF ONLINE]:\n"

for i = 1, #players do
    if players[i]:getGroup():getId() > 1 and players[i]:getGroup():getId() <= staff_groupid then
        text = text..""..players[i]:getName().."\n"
    elseif players[i]:getGroup():getId() > staff_groupid then
    count = count - 1
    end
end
else
    for i = 1, #players do
        if players[i]:getGroup():getId() > 1 then
            count = count - 1
        end
    end
end

text = text.."\n[PLAYER COUNT]: "..count

rand = math.random(1, array_amount)

doShowTextDialog(player, array_books[rand], text)
return false
end

I like mine better...
 
Last edited:
Back
Top