Ninjamon Posted March 12, 2013 Group: Members Topic Count: 113 Topics Per Day: 0.03 Content Count: 295 Reputation: 2 Joined: 03/06/12 Last Seen: November 4, 2014 Share Posted March 12, 2013 I need a npc that if you will designate a specific code. Example the code is "jdsa41jd" and if a player put that code on the npc he will receive a specific Item(s) (Can only be used 1 per IP or 1 Per Account) Quote Link to comment Share on other sites More sharing options...
Ninjamon Posted March 12, 2013 Group: Members Topic Count: 113 Topics Per Day: 0.03 Content Count: 295 Reputation: 2 Joined: 03/06/12 Last Seen: November 4, 2014 Author Share Posted March 12, 2013 It looks like this http://rathena.org/board/topic/63332-coupon-npc-112/ But it gives a player the item when he just know the code. Unlike that after you type the code, no one can retype it again. Quote Link to comment Share on other sites More sharing options...
Ninjamon Posted March 12, 2013 Group: Members Topic Count: 113 Topics Per Day: 0.03 Content Count: 295 Reputation: 2 Joined: 03/06/12 Last Seen: November 4, 2014 Author Share Posted March 12, 2013 up Quote Link to comment Share on other sites More sharing options...
Ninjamon Posted March 12, 2013 Group: Members Topic Count: 113 Topics Per Day: 0.03 Content Count: 295 Reputation: 2 Joined: 03/06/12 Last Seen: November 4, 2014 Author Share Posted March 12, 2013 up Quote Link to comment Share on other sites More sharing options...
Ninjamon Posted March 13, 2013 Group: Members Topic Count: 113 Topics Per Day: 0.03 Content Count: 295 Reputation: 2 Joined: 03/06/12 Last Seen: November 4, 2014 Author Share Posted March 13, 2013 up Quote Link to comment Share on other sites More sharing options...
Shakto Posted March 15, 2013 Group: Members Topic Count: 14 Topics Per Day: 0.00 Content Count: 403 Reputation: 89 Joined: 02/07/13 Last Seen: Saturday at 10:39 AM Share Posted March 15, 2013 (edited) Use the sql table with all you coupon You have to delete the row in the script : query_sql "DELETE FROM `coupons` WHERE `code`='"+@my_code$+"'"; query_sql "SELECT `code`, `item_id`, `item_amount` FROM `coupons`", .@available_code$, .@available_item, .@available_amount; for (set @i, 0; @i < getarraysize(.@available_code$); set @i, @i+1) { if(@my_code$==.@available_code$[@i]) { mes "[^FF7700Coupon Jack^000000]"; mes "You get ^0000FF" + getitemname(.@available_item[@i]) + " - " + .@available_amount[@i] + " ea.^000000"; getitem .@available_item[@i],.@available_amount[@i]; //announce "Coupon Jack: " + strcharinfo(0) + " got " + .@available_amount[@i] + getitemname(.@available_item[@i]) + "(s).",0; close; } } And for IP verification : create an other table (code of coupon,player ip), you can have player ip by checking the login table : query_sql "SELECT `last_ip` FROM `login` WHERE `account_id` = "+getcharid(3)+"", .@IP; You can do that for both account_id or ip, like you want And you fill the new table with a query ; INSERT INTO After you just have to check if the player already used his coupon Edited March 15, 2013 by Shakto Quote Link to comment Share on other sites More sharing options...
Question
Ninjamon
I need a npc that if you will designate a specific code.
Example the code is "jdsa41jd" and if a player put that code on the npc he will receive a specific Item(s)
(Can only be used 1 per IP or 1 Per Account)
Link to comment
Share on other sites
5 answers to this question
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.