Kreustoo Posted May 17, 2020 Group: Members Topic Count: 34 Topics Per Day: 0.01 Content Count: 216 Reputation: 45 Joined: 05/03/13 Last Seen: March 9 Share Posted May 17, 2020 (edited) View File 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 Kreustoo Submitted 05/15/2020 Category Utilities Video Content Author Kreustoo Edited June 1, 2020 by Kreustoo Quote Link to comment Share on other sites More sharing options...
daL Posted May 18, 2020 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 16 Reputation: 0 Joined: 09/27/12 Last Seen: Sunday at 04:33 PM Share Posted May 18, 2020 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. Thanks for your support .. ^_^ Quote Link to comment Share on other sites More sharing options...
Kreustoo Posted May 18, 2020 Group: Members Topic Count: 34 Topics Per Day: 0.01 Content Count: 216 Reputation: 45 Joined: 05/03/13 Last Seen: March 9 Author Share Posted May 18, 2020 (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 May 19, 2020 by Kreustoo Quote Link to comment Share on other sites More sharing options...
nickhun07 Posted May 23, 2020 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 2 Reputation: 0 Joined: 06/12/12 Last Seen: 17 hours ago Share Posted May 23, 2020 How to make it work with another language in UTF8? Quote Link to comment Share on other sites More sharing options...
Kreustoo Posted June 1, 2020 Group: Members Topic Count: 34 Topics Per Day: 0.01 Content Count: 216 Reputation: 45 Joined: 05/03/13 Last Seen: March 9 Author Share Posted June 1, 2020 @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 Quote Link to comment Share on other sites More sharing options...
nickhun07 Posted June 1, 2020 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 2 Reputation: 0 Joined: 06/12/12 Last Seen: 17 hours ago Share Posted June 1, 2020 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. Quote Link to comment Share on other sites More sharing options...
Kreustoo Posted June 1, 2020 Group: Members Topic Count: 34 Topics Per Day: 0.01 Content Count: 216 Reputation: 45 Joined: 05/03/13 Last Seen: March 9 Author Share Posted June 1, 2020 @nickhun07Try with this? 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`)) 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.