tr0n Posted May 19, 2012 Group: Members Topic Count: 28 Topics Per Day: 0.01 Content Count: 562 Reputation: 153 Joined: 02/21/12 Last Seen: February 27, 2024 Author Share Posted May 19, 2012 but that could only mean that the code wasn't deleted. Or am I wrong ? Quote Link to comment Share on other sites More sharing options...
WhatFT Posted May 19, 2012 Group: Members Topic Count: 142 Topics Per Day: 0.03 Content Count: 511 Reputation: 7 Joined: 02/15/12 Last Seen: April 11, 2014 Share Posted May 19, 2012 The code is deleted in the sql but the codes in-game doesn't erased. I restarted my server and everything. The first version is working fine but the problem is, it has some bugs that can dupe. Quote Link to comment Share on other sites More sharing options...
tr0n Posted May 19, 2012 Group: Members Topic Count: 28 Topics Per Day: 0.01 Content Count: 562 Reputation: 153 Joined: 02/21/12 Last Seen: February 27, 2024 Author Share Posted May 19, 2012 I think i found the bug ! the codes will be selected from database and saved into a array and it doesn't erase before relog. so i need to clean them ! FINALLY ! I'm going to fix that now. Quote Link to comment Share on other sites More sharing options...
Tonetzkii Posted May 19, 2012 Group: Members Topic Count: 47 Topics Per Day: 0.01 Content Count: 323 Reputation: 9 Joined: 11/19/11 Last Seen: September 25, 2015 Share Posted May 19, 2012 Exactly thats why ill put the kick commands. Quote Link to comment Share on other sites More sharing options...
tr0n Posted May 19, 2012 Group: Members Topic Count: 28 Topics Per Day: 0.01 Content Count: 562 Reputation: 153 Joined: 02/21/12 Last Seen: February 27, 2024 Author Share Posted May 19, 2012 Fixed. please test! Quote Link to comment Share on other sites More sharing options...
quesoph Posted May 19, 2012 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 210 Reputation: 10 Joined: 11/20/11 Last Seen: August 23, 2015 Share Posted May 19, 2012 You don't need to add newlines.. you just simply change these: @available_code$, @available_item, @available_amount to these: .@available_code$, .@available_item, .@available_amount and every line that contains these variable. works fine with me. Quote Link to comment Share on other sites More sharing options...
tr0n Posted May 19, 2012 Group: Members Topic Count: 28 Topics Per Day: 0.01 Content Count: 562 Reputation: 153 Joined: 02/21/12 Last Seen: February 27, 2024 Author Share Posted May 19, 2012 You don't need to add newlines.. you just simply change these: @available_code$, @available_item, @available_amount to these: .@available_code$, .@available_item, .@available_amount and every line that contains these variable. works fine with me. WTF IS WRONG WITH ME ? I totally lost my brain! <.< and yes this works, thanks. Fixed it finally Quote Link to comment Share on other sites More sharing options...
quesoph Posted May 19, 2012 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 210 Reputation: 10 Joined: 11/20/11 Last Seen: August 23, 2015 Share Posted May 19, 2012 Glad it helped. Quote Link to comment Share on other sites More sharing options...
WhatFT Posted May 19, 2012 Group: Members Topic Count: 142 Topics Per Day: 0.03 Content Count: 511 Reputation: 7 Joined: 02/15/12 Last Seen: April 11, 2014 Share Posted May 19, 2012 (edited) It's working now ! Thanks tr0n and quesoph.. I added the codes and gave it to my testing char, and finally... it was deleted immediately and I tried even typing the same code, it has no bugs at all, instant delete in "Show Coupons" and in database, looking forward to have improvements and others ~ THANKS ! Suggestions : Try adding some broadcast on it, example <name> obtained <amount> <item id> in Coupon Jack ! .[/b]. Edited May 19, 2012 by Paulinds Quote Link to comment Share on other sites More sharing options...
Tonetzkii Posted May 20, 2012 Group: Members Topic Count: 47 Topics Per Day: 0.01 Content Count: 323 Reputation: 9 Joined: 11/19/11 Last Seen: September 25, 2015 Share Posted May 20, 2012 Thank you for fast update more power!. im not using @kick script command now. Suggestion is possible to add the logs? Quote Link to comment Share on other sites More sharing options...
quesoph Posted May 21, 2012 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 210 Reputation: 10 Joined: 11/20/11 Last Seen: August 23, 2015 Share Posted May 21, 2012 (edited) It's working now ! Thanks tr0n and quesoph.. I added the codes and gave it to my testing char, and finally... it was deleted immediately and I tried even typing the same code, it has no bugs at all, instant delete in "Show Coupons" and in database, looking forward to have improvements and others ~ THANKS ! Suggestions : Try adding some broadcast on it, example <name> obtained <amount> <item id> in Coupon Jack ! .[/b]. [/quote] try this: [code] mes "[^FF7700Coupon Jack^000000]"; mes "You get ^0000FF" + getitemname(.@available_item[@i]) + " - " + .@available_amount[@i] + " ea.^000000"; query_sql "DELETE FROM `coupons` WHERE `code`='"+@my_code$+"'"; getitem .@available_item[@i],.@available_amount[@i]; announce strcharinfo(0)+" Has Claimed "+ .@available_amount[@i] +"x "+ getitemname(.@available_item[@i]) +" for entering the coupon number: "+@my_code$,0; close; Thank you for fast update more power!. im not using @kick script command now. Suggestion is possible to add the logs? ../conf/log_athena.conf enable this: 0x00020 - (N) Log Script transactions (items deleted/acquired through quests) Edited May 21, 2012 by quesoph Quote Link to comment Share on other sites More sharing options...
WhatFT Posted May 21, 2012 Group: Members Topic Count: 142 Topics Per Day: 0.03 Content Count: 511 Reputation: 7 Joined: 02/15/12 Last Seen: April 11, 2014 Share Posted May 21, 2012 @quesoph Thank you sir ~ It's working now Quote Link to comment Share on other sites More sharing options...
tr0n Posted May 21, 2012 Group: Members Topic Count: 28 Topics Per Day: 0.01 Content Count: 562 Reputation: 153 Joined: 02/21/12 Last Seen: February 27, 2024 Author Share Posted May 21, 2012 UPDATE TO 1.1.2 Now you're able to activate announce if a player gets a item. uncomment line '104' to activate it. Quote Link to comment Share on other sites More sharing options...
Uncle Drew Posted March 5, 2017 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 1 Reputation: 0 Joined: 02/18/17 Last Seen: March 7, 2017 Share Posted March 5, 2017 +99 for this ! thanks! Quote Link to comment Share on other sites More sharing options...
LOVE0825 Posted September 3, 2017 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 27 Reputation: 0 Joined: 10/18/13 Last Seen: July 6, 2019 Share Posted September 3, 2017 You can set the number of records in the account at what time to use this serial number to get the serial number of items Quote Link to comment Share on other sites More sharing options...
Haikenz Posted September 3, 2017 Group: Members Topic Count: 84 Topics Per Day: 0.02 Content Count: 309 Reputation: 82 Joined: 11/15/11 Last Seen: October 1, 2023 Share Posted September 3, 2017 (edited) On 12/05/2012 at 11:36 PM, tr0n said: Coupon NPC I had the idea from here: http://rathena.org/b...ional-code-npc/ I decided to make my own script. How does this works ? The admin speaks to the npc and he/she can add a new coupon. The code will be generated randomly and automatic and everything will be saved in database. You can set the code length in script. You only need to enter the item id and the amount. If a player speaks to the npc he/she can submit a coupon and get the stuff. The code will be deleted from database after it was used. Notice: Coupon Codes are limited to 128 (array limit) Files coupon_system.txt coupon_npc_1.1.0.txt coupon_npc_1.1.1.txt coupon_npc_1.1.2.txt Changelogs 1.0.0 Release 1.1.0 Added code type feature (normal|md5-hash) 1.1.0 Added prevention for typing 0 into Item ID or Amount 1.1.0 Added a feature for gms to see available coupons 1.1.0 Minor bug fixes 1.1.1 Fixed a bug that caused duplicating items 1.1.2 Added announce if player got a item Features Saves coupons in database randomly generated codes very easy to use How can you help me ? Give me feedback Report bugs Tell me if you like it tr0n 1. How to add the duration of a coupon? ex: valid only for 1 week, valid for 1 month... 2. how to use code on account, not to be used repeatedly in other chars 3. has some way the code stays in this form: aaaa-bbbb-cccc separated by: - from 3 in 3 code 4. how to add multiple items to win in just 1 coupon Edited September 3, 2017 by Haikenz 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.