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

Solved How to make "!online" and other talkactions "invisible" for other players?

flaxe

the one and only
Joined
Jun 12, 2009
Messages
336
Reaction score
2
Location
Sweden
Hello, as the topic says I want to make some talkactions "invisible" for other players. With this I mean that when you say ex. !online, then another player shouldn't be able to see that word. I hope you understand. I don't think that you need the script for the talkaction, so I won't post it. But if you really do need it, then I will post it. Thanks!
 
Last edited:
It should by like that in default. You have done some modifications with talkactions? For example moving directories from 1 TFS version to other? Because there was much changes/rewerts with returns. You can open for example online.lua and see if there is return TRUE at bottom, if yes, change it to return FALSE, otherwise change return FALSE to return TRUE. You must do it in all scripts.
 
I havn't done any modifications with my talkactions, and I also have no "return = ***" in my online.lua file, I'm posting my online.lua file below so you can see how it looks like:

Code:
local showLevels = 1
local maxPlayers = 0
local showAccess = {
	[0] = "yes", --Players
	[1] = "no", --GMs
	[2] = "no", --God
}
function onSay(cid, words, param)
	players = getOnlinePlayers()
	count = 0
	numPlayers = 0
	text = ""
	for i = 1,#players do
		p = getPlayerByName(players[i])
		for j = 1, #showAccess do
			access = j - 1
			if getPlayerAccess(p) == access then
				if showAccess[access] == "yes" then
					count = count + 1
					numPlayers = numPlayers + 1
					if count == maxPlayers then
						count = 0
						text = text .. ", " .. players[i]
						doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, text)
					elseif count == 1 then
						text = players[i]
					else
						text = text .. ", " .. players[i]
					end
					if showLevels == 1 then
						text = text .. "["..getPlayerLevel(p).."]"
					end
				end
			end
		end
	end
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,  text .."\n")
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, numPlayers.." player(s) online.")
end

Thanks!
 
Code:
local showLevels = 1
local maxPlayers = 0
local showAccess = {
	[0] = "yes", --Players
	[1] = "no", --GMs
	[2] = "no", --God
}
function onSay(cid, words, param)
	players = getOnlinePlayers()
	count = 0
	numPlayers = 0
	text = ""
	for i = 1,#players do
		p = getPlayerByName(players[i])
		for j = 1, #showAccess do
			access = j - 1
			if getPlayerAccess(p) == access then
				if showAccess[access] == "yes" then
					count = count + 1
					numPlayers = numPlayers + 1
					if count == maxPlayers then
						count = 0
						text = text .. ", " .. players[i]
						doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, text)
					elseif count == 1 then
						text = players[i]
					else
						text = text .. ", " .. players[i]
					end
					if showLevels == 1 then
						text = text .. "["..getPlayerLevel(p).."]"
					end
				end
			end
		    end
		end
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,  text .."\n")
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, numPlayers.." player(s) online.") 
	return TRUE
end
 
It works now =) Thank you slawkens for telling me how to do it and chris77 that showed me exactly how it should look like ;)

Thread can be closed
 
Back
Top