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

Command !online and Teleport rune

Deaven

New Member
Joined
Jun 1, 2009
Messages
55
Reaction score
2
Hello.
I am looking for someone to help me redo the command (!online) so that showed the players online and server power:
Code:
Players Online:
- - - - - - - - -
Administrators Online:
- - - - - - - - -
Game Masters Online:
- - - - - - - - - 
Banners Online:
- - - - - - - - - 
Consullers Online:
- - - - - - - - - 
Tutors Online:
- - - - - - - - -

Basic:
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

    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

The second thing I would like to ask for help in conversion to my runes to teleport that teleports us to a place on the screen in which you click, the problem is that teleports us also to water, walls, fire and rocks, I would like to block

Code:
[COLOR=#000000]function onUse(cid, item, frompos, item2, topos)
   if getTilePzInfo(topos) or getThingFromPos({x=topos.x,y=topos.y,z=topos.z,stackpos=255}) == true then return false end
    doTeleportThing(cid, topos, FALSE)
    doSendMagicEffect(pos, 10)
   doRemoveCondition(cid, 11) 
end

[/COLOR]Thank you in advance for your help and sorry for poor English
 
Online command with staff :
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
	local staff = {}
	for _, pid in ipairs(players) do
	    if getPlayerAccess(pid) > 2 then
            table.insert(staff, pid)
		end
		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)) and getPlayerAccess(pid) < 3) then
			strings[position] = strings[position] .. getCreatureName(pid) .. " [" .. getPlayerLevel(pid) .. "]"
			i = i + 1
			added = true
		else
			added = false
		end
	end
 
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. " player(s) and " .. #staff .. " staff member(s) online:")
	for i, str in ipairs(strings) do
		if(str:sub(str:len()) ~= ",") then
			str = str .. "."
		end
		local text = ""
		local sep = ", "
        	for i = 1, #staff do
			if i == #staff - 1 then
				sep = " and "
			elseif i == #staff then
				sep = "."
			end
			text = text .. getCreatureName(staff[i]) .. sep
		end
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player(s): " .. str)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Staff member(s): " .. text)
	end
 
	return true
end

Click on the * near of me :D xD or just Thank Me :)
 
Back
Top