Jump to content

Recommended Posts

Posted (edited)

News NPC


Description
A News npc that will let the players read news from the server stocked in sql. It can print colors and show an animated showevent to attract players if there's a new news.
Each news is separated in 2, the resume and more. Make a short version of your news and then explain it more. That way you have more chance to spread at least the important part of it to the players.

Installation
-Run this sql command

CREATE TABLE IF NOT EXISTS `z_custom_news` (`id` int(11) NOT NULL AUTO_INCREMENT,`News` text NOT NULL,`Resume` text NOT NULL,`More` text NOT NULL,PRIMARY KEY (`id`))

-Add news

-Edit the !!Modify  Lines

-Check if you want to edit anything in the OnInit.

-Load the npc (news.txt) and voila!

-The news are sql and to update in game, just make a gm talk to it, no need to reload it each time. Not making it checking each time someone talk to it (or each hour ect) make the npc less ressource consuming, but you can edit it and make the request everytime.

Information
-It does not make a lot of sql request, it only update when a gm talk to it and chose to update.

-It saves the highest news seen and print an event to attract the attention of the player, commenting all the !!Saving Mecanism!! lines removes it. It does not save which one you saw.

-You can add color using ^RRGGBB and adding new lines using # (editable)
 


  • Submitter
  • Submitted
    05/15/2020
  • Category
  • Video
     
  • Content Author
    Kreustoo

 

Edited by Kreustoo

Share this post


Link to post
Share on other sites

good day brother.. sorry i want to ask to you why when i update it at npc but nothing happen and i only able to update news from database manually this is the picture.

manual.png
screenGatherRO048.jpg

 

screenGatherRO049.jpg

 

Thanks for your support ..

^_^

Share this post


Link to post
Share on other sites
Posted (edited)

@daLWeeeeelll, maybe it's not obvious but when you're a gm, talk to it again without updating it. I think that's just that?
I'll make a patch making that after updating it go to the news part even for gm directly.

EDIT: Patch uploaded, 1.2.0 it is

Edited by Kreustoo

Share this post


Link to post
Share on other sites

How to make it work with another language in UTF8?

Share this post


Link to post
Share on other sites

@nickhun07 What is the problem? You have some character being weird inside the npc?
I used to print french accent in it without any problem 😮

Share this post


Link to post
Share on other sites
4 hours ago, Kreustoo said:

@nickhun07 What is the problem? You have some character being weird inside the npc?
I used to print french accent in it without any problem 😮

I would like to print Thai language and i did change Collation in Mysql to UTF8_unicode_ci.  it shows ?????????? in game.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.