• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Experience door and !online function

Olausson92

New Member
Joined
Sep 12, 2008
Messages
49
Reaction score
0
Location
Sweden / Ljungby
Hello,

im using The Forgotten Server 0.3.1 and just hosted my Roxor map.

But the experience doors are not working and the **!online** function are not working to.

i think there is a .lua file or something that is not working corectly.

Please help me out with this! people stop playing on my server><
 
data/talkactions/scripts/online.lua
PHP:
local config = {
    showGamemasters = getConfigInfo('displayGamemastersWithOnlineCommand')
}

function onSay(cid, words, param)
    local players = getPlayersOnline()
    local strings = {}
    local pos = 1
    local count = 0
    local tmp = TRUE
    for i, pid in ipairs(players) do
        if(tmp == TRUE) then
            if(i > pos * 7) then
                pos = pos + 1
            end

            if(strings[pos] == nil) then
                strings[pos] = ""
                line = ""
            end
        end

        tmp = TRUE
        if((getBooleanFromString(config.showGamemasters) == FALSE and getPlayerCustomFlagValue(pid, PlayerCustomFlag_GamemasterPrivileges) == TRUE and getPlayerCustomFlagValue(cid, PlayerCustomFlag_GamemasterPrivileges) == FALSE) or (isPlayerGhost(pid) == TRUE and getPlayerAccess(pid) > getPlayerAccess(cid))) then
            count = count + 1
            tmp = FALSE
        else
            strings[pos] = strings[pos] .. "\n" .. getCreatureName(pid) .. " [" .. getPlayerLevel(pid) .. "]"
        end
    end
    for i, string in ipairs(strings) do
        if(string ~= "") then
                doShowTextDialog(cid, 8918, "Players online: "..(#players- count).."\n"..string)
        end
    end
    return TRUE
end

in talkactions.xml
PHP:
<talkaction words="!online" event="script" value="online.lua"/>


please help me with the Experience door problem

you set an actionID in the experience door? (like aid 1030 for lvl 30+)
 
It doesent happening anything when i use !online.

here is my talkactions.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<talkactions>
	<!-- player talkactions -->
	<talkaction words="!leavehouse" script="leavehouse.lua"/>
	<talkaction words="!save" script="save.lua"/>
	<talkaction words="!changesex" script="changesex.lua"/>
	<talkaction words="!uptime" script="uptime.lua"/>
	<talkaction words="!deathlist" script="deathlist.lua"/>
 	<talkaction words="fuck" script="filter.lua" />
    	<talkaction words="dick" script="filter.lua" />
    	<talkaction words="bitch" script="filter.lua" />
        <talkaction words="/jail" script="jailing.lua" />
        <talkaction words="/unjail" script="jailing.lua" />
	<talkaction words="!buy" script="buy.lua" />>
	<talkaction words="1337 rocks" script="tp.lua" />
	<talkaction words="shit" script="tp scroll.lua" />
	<talkaction words="music" script="tp cult.lua" />
	<talkaction words="cormaya" script="tp cormaya.lua" />
 	<talkaction words="!jail" script="jailsystem.lua"/>
    	<talkaction words="!unjail" script="jailsystem.lua"/>
    	<talkaction words="/jail" script="jailsystem.lua"/>
        <talkaction words="!online" event="script" value="online.lua"/>  
    	<talkaction words="/unjail" script="jailsystem.lua"/>
	<talkaction words="/speed" script="speeding.lua" />
	
	<!-- test talkactions -->
	<talkaction words="!z" script="magiceffect.lua"/>
	<talkaction words="!x" script="animationeffect.lua"/>


</talkactions>
 
put this to ur online.lua

PHP:
local config = {
	showGamemasters = getBooleanFromString(getConfigInfo('displayGamemastersWithOnlineCommand'))
}

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

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

		if((config.showGamemasters == TRUE or getPlayerCustomFlagValue(cid, PlayerCustomFlag_GamemasterPrivileges) == TRUE or getPlayerCustomFlagValue(pid, PlayerCustomFlag_GamemasterPrivileges) ~= TRUE) and (isPlayerGhost(pid) ~= TRUE or getPlayerAccess(cid) >= getPlayerAccess(pid))) then
			strings[position] = strings[position] .. getCreatureName(pid) .. " [" .. getPlayerLevel(pid) .. "]"
			i = i + 1
		end
	end

	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. " player(s) online:")
	for i, str in ipairs(strings) do
		if(str:sub(str:len()) ~= ",") then
			str = str .. "."
		end

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str)
	end

	return TRUE
end
 
Back
Top