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

!online

Amiroslo

Excellent OT User
Joined
Jul 28, 2009
Messages
6,768
Solutions
5
Reaction score
769
i want like this script

[EXAMPLE] When a player says !online, he sees this:



[XXX OTS] At the moment there is 59 player(s) online. To see the complet list of names, say: !players.

Of these players, we have: 19 Wizards, 26 Magicians, 54 Rangers and 30 Fighters.

Which are divided to free accounts (69) and VIP accounts (34).

And our uptime is 83 hours and 12 minutes.

PS: VIP accounts- Kekox system!
 
Lua:
function onSay(cid, words, param, channel)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[XXX OTS] At the moment there is ".. getOnlinePlayers() .." player(s) online. To see the complet list of names, say: !players.")
	return true
end

Lua:
function onSay(cid, words, param, channel)
	local tmp = getWorldUpTime()
	local hours = math.ceil(tmp / 3600) - 1
	local minutes = math.ceil((tmp - (3600 * hours)) / 60)
	if(minutes == 60) then
		minutes = 0
		hours = hours + 1
	end
 
	local players = getPlayersOnline()
	local strings = {""}
	local sorc,druid,paladin,knight,rook = 0,0,0,0,0
 
	local i, position = 1, 1
	local added = false
	for _, pid in ipairs(players) do
		if isSorcerer(pid) then
			sorc = sorc + 1
		elseif isDruid(pid) then
			druid = druid + 1
		elseif isPaladin(pid) then
			paladin = paladin + 1
		elseif isKnight(pid) then
			knight = knight + 1
		elseif isRookie(pid) then
			rook = rook + 1
		elseif isPremium(pid) then
			prem = prem + 1
		end
	end
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Of these players, we have: ".. sorc .." Wizards, ".. druid .." Magicians, ".. paladin .." Rangers and ".. knight .."	Fighters.")
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Which are divided to free accounts (".. getOnlinePlayers() - prem ..") and VIP accounts (".. prem ..").")
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "And our uptime is ".. hours .." hours and ".. minutes .." minutes.")
	return true
end

It's should works.
 
Last edited:
the first script is
talkactions/scripts/online.lua
second
talkactions/scripts/players.lua
like this? :p
 
+ its not working, the online thing aint working, and when i say !players, it just shows the voc not uptime and all, its kinda bugged
well i fail at scripting but i tried to do it like this and it kinda worked
Lua:
function onSay(cid, words, param, channel)
	local tmp = getWorldUpTime()
	local hours = math.ceil(tmp / 3600) - 1
	local minutes = math.ceil((tmp - (3600 * hours)) / 60)
	if(minutes == 60) then
		minutes = 0
		hours = hours + 1
	end
 
	local players = getPlayersOnline()
	local strings = {""}
	local sorc,druid,paladin,knight,rook = 0,0,0,0,0
 
	local i, position = 1, 1
	local added = false
	for _, pid in ipairs(players) do
		if isSorcerer(pid) then
			sorc = sorc + 1
		elseif isDruid(pid) then
			druid = druid + 1
		elseif isPaladin(pid) then
			paladin = paladin + 1
		elseif isKnight(pid) then
			knight = knight + 1
		elseif isRookie(pid) then
			rook = rook + 1
		elseif isPremium(pid) then
			prem = prem + 1
		end
	end
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (i + 0) .. " We have: ".. sorc .." Wizards, ".. druid .." Magicians, ".. paladin .." Rangers and ".. knight .."Fighters.")
	return true
end
but with no uptime etc..
 
Back
Top