Jump to content

IO.Open Function - Announcements


Syron

Recommended Posts

M2 Download Center

This is the hidden content, please
( Internal )

Hello metin2dev, i will teach you how to use the io.open function. You can create an editable quest announcement without restarting the server or reload anything.

 

On login example

quest ioopenexample_1 begin
  state start begin
    when login begin 
      announcements = io.open("locale/location/announcements.txt")
      notice("News:"..announcements:read()) 
    end
  end
end

That's pretty simple. :D

  • Metin2 Dev 4
  • Good 2
  • Love 1
  • Love 9
Link to comment
Share on other sites

  • 2 weeks later...
  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Hello metin2dev, i will teach you how to use the io.open function. You can create an editable quest announcement without restarting the server or reload anything.

 

• on login example

quest ioopenexample_1 begin
state start begin
when login begin 
announcements = io.open("locale/location/announcements.txt")
notice("News:"..announcements:read()) 
end 
end
end

That's pretty simple. :D

 


(get_locale_base_path().."/announcements.txt")

maybe this could be better

Link to comment
Share on other sites

 

Hello metin2dev, i will teach you how to use the io.open function. You can create an editable quest announcement without restarting the server or reload anything.

 

• on login example

quest ioopenexample_1 begin
state start begin
when login begin 
announcements = io.open("locale/location/announcements.txt")
notice("News:"..announcements:read()) 
end 
end
end

That's pretty simple. :D

 


(get_locale_base_path().."/announcements.txt")

maybe this could be better

 

It's not necessary to run the txt from locale , it can be anywhere else.

E.g.: /usr/home/game/for_quests/announcements.txt

But , good point !

Link to comment
Share on other sites

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.