[MOD] Character Count Limiter

Place for sharing your game modifications for Life is Feudal: Your Own

Alakar
Beta Tester
 
Posts: 202
Joined: 23 Jan 2015, 07:39

Re: [MOD] Character Count Limiter

Post by Alakar » 19 Mar 2015, 00:20

Its because the client doesn't get passed that message they can only display the message that an error has occured because that is all the server returns to them.


Gorgin
 
Posts: 8
Joined: 12 Mar 2015, 03:16

Re: [MOD] Character Count Limiter

Post by Gorgin » 23 Mar 2015, 00:06

So how would i go about fixing that? I have been on a server that had a custom message pop up when you tried to make more the there set number and i never had to DL any extra files.

User avatar
HouseHarkonnen
 
Posts: 37
Joined: 30 Sep 2014, 20:22

Re: [MOD] Character Count Limiter

Post by HouseHarkonnen » 28 Jun 2015, 20:01

Works just noticed the code posted is set for a 2 character limit and I only need to edit that to one.
Image


Zhalls
Alpha Tester
 
Posts: 89
Joined: 14 Mar 2014, 19:30

Re: [MOD] Character Count Limiter

Post by Zhalls » 13 Aug 2015, 07:06

So it turns out that this script is no longer working as intended, because it also blocks you from deleting existing characters. This isn't exactly a bad thing, assuming you're combining it with a starter kit like me, which means they can't abuse the starter kit at creation by delting/recreating repeatedly for additional loot.

The following is my code, maybe someone can help me figure out why it's blocking me from deleting characters now for in the event I want to actually allow it:

Code: Select all
BEGIN
SET @characterCount = (SELECT COUNT(*) FROM `character` ch WHERE ch.AccountID = NEW.AccountID);
   IF @characterCount > 1 THEN
      SET @msg = "Cannot create more than 1 characters per account";
      SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = @msg;
         END IF;
   SET @sack = f_createContainer(NEW.RootContainerID, 459, 0);
   SET @temp = f_insertNewItemInventory(@sack, 555, 50, 1, 50000, 50000, NULL, NULL); /* practice sword */
   SET @temp = f_insertNewItemInventory(@sack, 41, 100, 1, 50000, 50000, NULL, NULL); /* primitive shovel */
   SET @temp = f_insertNewItemInventory(@sack, 43, 100, 1, 50000, 50000, NULL, NULL); /* primitive hammer */
   SET @temp = f_insertNewItemInventory(@sack, 45, 100, 1, 50000, 50000, NULL, NULL); /* primitive axe */
   SET @temp = f_insertNewItemInventory(@sack, 50, 100, 1, 50000, 50000, NULL, NULL); /* primitive saw */
   SET @temp = f_insertNewItemInventory(@sack, 30, 100, 1, 50000, 50000, NULL, NULL); /* primitive sickle */
   SET @temp = f_insertNewItemInventory(@sack, 47, 100, 1, 50000, 50000, NULL, NULL); /* primitive pickaxe */
   SET @temp = f_insertNewItemInventory(@sack, 289, 100, 1, 50000, 50000, NULL, NULL); /* primitive knife */
   SET @temp = f_insertNewItemInventory(@sack, 974, 50, 25, 50000, 50000, NULL, NULL); /* 25x q50 Apple Buns */
   SET @temp = f_insertNewItemInventory(@sack, 1028, 50, 1, 15000, 15000, NULL, NULL); /* primitive cooking pot */
END


DonSmirelo
 
Posts: 1
Joined: 10 Jul 2017, 17:47

Re: [MOD] Character Count Limiter

Post by DonSmirelo » 10 Jul 2017, 17:49

Добрый день, подскажите когда я устанавливаю данный код в файл patch.sql у меня падает сервер. Может там надо вместо root и lovalhost данные базы данных ввести? Прошу прощения не очень разбираюсь в программировании)) :D

Return to Game mods