RESOURCES HUB
Premium
Add a little "system" on your Metin2 server, when you make an update -> players get a PM (Whisper) with what changes have been made to the server.
It is written only in python + LUA (quest), very simple to implement by anyone!
- All players will receive this Private Message when they connect to the server.
- It appears only once, so players will not receive this message every time they log in, only the first time.
We open game.py and search for:
We add:
We are looking for:
We add:
This is what it should look like:
Install the next quest:
Now, we create a folder in the "quest" folder called "notice" and add 2 txt with the names: notice.txt and qf.txt.
In qf.txt you will have to put a number for example 0 we add a 0 and hit save, and in notice we put what we want to appear in pm.
In case we don't have the readline function we add:
We add the following to quest_functions:
How do I add a new message?
1) Open notice.txt from the notice fodler, and add the message that you want to appear in PM to players.
2) Open qf.txt and change the number there +1. That is if we have 0, we change it to 1.
Now, the message will appear to the players at first login.
If we did another update, we do the same. We change the message in notice.txt and change in qf.txt from 1 --> to 2.
Now the new message will appear again to players at first login.
It is written only in python + LUA (quest), very simple to implement by anyone!
- All players will receive this Private Message when they connect to the server.
- It appears only once, so players will not receive this message every time they log in, only the first time.

We open game.py and search for:
Code:
"mall"
Code:
"open_notice_info" : self.__open_notice_info,
"write_notice_info" : self.__write_notice_info,
Code:
__InGameShop_Show(self,url):
Code:
def __open_notice_info(self):
self.interface.RegisterGameMasterName("<--System-->")
self.interface.RecvWhisper("<--System-->")
def __write_notice_info(self,text):
chat.AppendWhisper(chat.WHISPER_TYPE_CHAT, "<--System-->", text.replace("_", " "))
Install the next quest:
Code:
quest reizo_notice begin
state start begin
function read_notice_line(l)
return readline("/quest/notice/notice.txt", l)
end
when login begin
local qf = readline("/quest/notice/qf.txt", 1)
local lineas = 0
if tonumber(qf) > pc.getqf("reizo_notice") then
for line in io.lines("/quest/notice/notice.txt") do lineas = lineas + 1 end
cmdchat("open_notice_info")
for i = 1,lineas do
cmdchat("write_notice_info "..string.gsub(reizo_notice.read_notice_line(i), ' ', '_'))
end
pc.setqf("reizo_notice", qf)
end
end
end
end
In qf.txt you will have to put a number for example 0 we add a 0 and hit save, and in notice we put what we want to appear in pm.
In case we don't have the readline function we add:
Code:
function readline(path, x)
local linetable = {}
for line in io.lines(path) do
table.insert(linetable, line)
end
return linetable[x]
end
Code:
readline
io.lines
1) Open notice.txt from the notice fodler, and add the message that you want to appear in PM to players.
2) Open qf.txt and change the number there +1. That is if we have 0, we change it to 1.
Now, the message will appear to the players at first login.
If we did another update, we do the same. We change the message in notice.txt and change in qf.txt from 1 --> to 2.
Now the new message will appear again to players at first login.