Jump to content
  • 0

Coupon / Promo Code


Ninjamon

Question


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  295
  • Reputation:   2
  • Joined:  03/06/12
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  295
  • Reputation:   2
  • Joined:  03/06/12
  • Last Seen:  

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. :(

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  295
  • Reputation:   2
  • Joined:  03/06/12
  • Last Seen:  

up

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  295
  • Reputation:   2
  • Joined:  03/06/12
  • Last Seen:  

up

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  295
  • Reputation:   2
  • Joined:  03/06/12
  • Last Seen:  

up

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  403
  • Reputation:   89
  • Joined:  02/07/13
  • Last Seen:  

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 by Shakto
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...