Hi, I have the trade on my server and I would like the players at birth to have some coins in the inventory.
Could someone explain to me how to do it?
Thank you.
Re: Coins in inventory
2I use trigger In MySQL: character_after_insert
CREATE DEFINER=`root`@`%` TRIGGER `character_after_insert` BEFORE INSERT ON `character` FOR EACH ROW BEGIN
-- f_insertNewItemInventory()
-- INSERT INTO items(`ContainerID`, `ObjectTypeID`, `Quality`, 1, 20000, 20000, NULL)
SET @backpack = NEW.RootContainerID;
SET @temp = f_insertNewItemInventory(@backpack, 44, 50, 1, 20000, 20000, NULL, 0, NULL, NULL, NULL, NULL); /* mallet */
END
CREATE DEFINER=`root`@`%` TRIGGER `character_after_insert` BEFORE INSERT ON `character` FOR EACH ROW BEGIN
-- f_insertNewItemInventory()
-- INSERT INTO items(`ContainerID`, `ObjectTypeID`, `Quality`, 1, 20000, 20000, NULL)
SET @backpack = NEW.RootContainerID;
SET @temp = f_insertNewItemInventory(@backpack, 44, 50, 1, 20000, 20000, NULL, 0, NULL, NULL, NULL, NULL); /* mallet */
END
A practitioner will always shoot a theorist ...
P.S. Russia, Siberia
P.S. Russia, Siberia
Re: Coins in inventory
3Thanks for you interest but..
But...
Query: CREATE DEFINER=`root`@`%` TRIGGER `character_after_insert` BEFORE INSERT ON `character` FOR EACH ROW BEGIN -- f_insertNewItemInv...
Error Code: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DELIMITER' at line 7
Execution Time : 0 sec
Transfer Time : 0 sec
Total Time : 0.055 sec
Code: Select all
DELIMITER $$
CREATE DEFINER=`root`@`%` TRIGGER `character_after_insert` BEFORE INSERT ON `character` FOR EACH ROW BEGIN
-- f_insertNewItemInventory()
-- INSERT INTO items(`ContainerID`, `ObjectTypeID`, `Quality`, 1, 20000, 20000, NULL)
SET @backpack = NEW.RootContainerID;
SET @temp = f_insertNewItemInventory(@backpack, 44, 50, 1, 20000, 20000, NULL, 0, NULL, NULL, NULL, NULL); /* mallet */
END
DELIMITER ;
Query: CREATE DEFINER=`root`@`%` TRIGGER `character_after_insert` BEFORE INSERT ON `character` FOR EACH ROW BEGIN -- f_insertNewItemInv...
Error Code: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DELIMITER' at line 7
Execution Time : 0 sec
Transfer Time : 0 sec
Total Time : 0.055 sec
Re: Coins in inventory
4Keep in mind that such mechanic can be exploited easily.
People could create a new character, drop or transfer coins, delete the character, create a new one, repeat ...
Though of course it depends on how many coins you're giving to players. For low amounts it won't be worthwhile to exploit it I guess.
People could create a new character, drop or transfer coins, delete the character, create a new one, repeat ...
Though of course it depends on how many coins you're giving to players. For low amounts it won't be worthwhile to exploit it I guess.
Re: Coins in inventory
5Well, you are right, but I would like to be able to deliver the bones and balls, so they can create the monument.
The problem is that the code he gave me doesn't work for me
Thank you
The problem is that the code he gave me doesn't work for me
Thank you
Re: Coins in inventory
6go to your server FTP, there data/cm_createchar.xml. in that file you can edit what items each new character has in their inventory based on their race, quality is always 50.