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

CreatureEvent Info Chat!

Erexo

Kage
Premium User
Joined
Mar 27, 2010
Messages
741
Solutions
5
Reaction score
193
Location
Pr0land
GitHub
Erexo
Hello, i make nice script, INFO CHAT!
How this works?
Its a new chat, where write all news from serwer, who are killed and by who, who advanced etc.

In XML/Channels.xml add line:
XML:
<channel id="11" name="Info Chat" active="no"/>

Now you have your chat, but nothing write there ;( lets add some features:

Players Advance info:
Creaturescripts.xml
XML:
<event type="advance" name="InfoAdv" event="script" value="infoadv.lua"/>

login.lua (add before "return true")
Lua:
registerCreatureEvent(cid, "InfoAdv")

infoadv.lua (make in scripts folder)
Lua:
function onAdvance(cid, skill, oldLevel, newLevel)
	for _, pid in ipairs(getPlayersOnline()) do
		if skill == SKILL__LEVEL and newLevel % 50 == 0 then
			doPlayerSendChannelMessage(pid, "Advance", "Player " .. getCreatureName(cid) .. " advanced to " .. getPlayerLevel(cid) .. " level!", TALKTYPE_CHANNEL_O, 11);
		end
	end
 
	return true;
end
(I know its terrible long, if someone can make a table...)

Players Death/Kill info:
Creaturescripts.xml
XML:
<event type="kill" name="InfoDeath" event="script" value="infodeath.lua"/>

login.lua (add before "return true")
Lua:
registerCreatureEvent(cid, "InfoDeath")

infodeath.lua (make in scripts folder)
Lua:
function onKill (cid, target)
local nick = getCreatureName(target)
local nick2 = getCreatureName(cid)
	if isPlayer(cid) and isPlayer(target) then
                local lvl = getPlayerLevel(target)
		for _, pid in ipairs(getPlayersOnline()) do
			doPlayerSendChannelMessage(pid, "Death", "Player "..nick.." has been slain by "..nick2.." at "..lvl.." level.", TALKTYPE_CHANNEL_RN, 11)
		end
	end
return true
end

I will add new features!
If someone have an idea what can i add, just write here (or if someone make a new script).

Rate and comment :3

Thank you PANDA!
 
Last edited:
Maybe this will work:
Lua:
local lvls = {30, 50, 100, 150, 200, 250, 300}
function onAdvance(cid, skill, oldLevel, newLevel)
if skill == SKILL_LEVEL and isInArray(lvls, newLevel) then
	for _, pid in ipairs(getPlayersOnline())
		doPlayerSendChannelMessage(pid, "Advance" "Player "..getCreatureName(cid).." advanced to level "..getPlayerLevel(cid), TALKTYPE_CHANNEL_O, 11)
	end
end
return TRUE
end
 
or just..

function onAdvance(cid, skill, oldLevel, newLevel)
local nick = getCreatureName(cid)
for _, pid in ipairs(getPlayersOnline()) do
if getPlayerLevel(cid) == 30 then
doPlayerSendChannelMessage(pid, "Advance", "Player "..nick.." advanced to level ..locallevel..", TALKTYPE_CHANNEL_O, 11)
 
Lua:
function onAdvance(cid, skill, oldLevel, newLevel)
	for _, pid in ipairs(getPlayersOnline()) do
		if skill == SKILL__LEVEL and newLevel % 50 == 0 then
			doPlayerSendChannelMessage(pid, "Advance", "Player " .. getCreatureName(cid) .. " advanced to " .. getPlayerLevel(cid) .. " level!", TALKTYPE_CHANNEL_O, 11);
		end
	end
	 
	return true;
end
 
Last edited:
Back
Top