Thanks Stoneharry for this idea, however I thought it could be way easier for the users in the following way:
I have made an update to this script, making it very easy to add more rewards, and more items bound to a single option! All you have to do is add a new line to the 'table' and it will automatically add the new option for you!
For example you can add this:
Code:
{"Token", "G92JD03D", 11846, 5},
That will add a menu item named: 'I would like a Token', asks you to enter the code G92JD03D and give you item 11846x5. If you want the script to add another item to the player, simply add another: "itemid, itemcount" to the string, like this:
Code:
{"Token", "G92JD03D", 11846, 5, itemid2, itemcount2},
example:
{"Token", "G92JD03D", 11846, 5, 14156, 2},
UPDATE: It now saves data!
My version contains the following features:
- Add Codes for any Player
IN-GAME! via the In-Game GM itemtool.
- Saves Codes when used, codes may only be used once and are only available to the player the code is assigned to! (If you assign code "CSDD3563" to player "CLAIVER", then Player "IRLEET" can't use this code. Only "CLAIVER" can!)
- Very easy to add new items, it takes just one single line, and you can add as many items as you want, that the player will receive (including item-count) upon entering the code for the selected option.
- You can still set a Global 'Password' for every item (this password can always be used by anyone, at any time), but this is not as safe.
Files:
LUA: Put this anywhere in the scripts/ folder.
http://www.mediafire.com/file/qgj21ztqykn/
SQL: Execute this into your MySql DataBase.
http://www.mediafire.com/file/2mlzw5moj4j/
TXT: Place this file into your /scripts folder (IMPORTANT!).
http://www.mediafire.com/file/nohztia2mnm/
Note: The current ItemID's are not all correct and are mostly custom items. Change them to your needs.
Claiver