Jump to content
  • 0

Reward NPC: enter code and redeem for item


GMKoji

Question


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  43
  • Reputation:   0
  • Joined:  02/17/12
  • Last Seen:  

RE: http://rathena.org/board/topic/79159-scripting-with-a-little-bit-of-sql/

would it be possible that only 1 code per person?

ex. code 1 is claimed by one player then other players wont be able to claim it anymore. hehe :)

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  72
  • Reputation:   0
  • Joined:  10/28/12
  • Last Seen:  

I am using this, it's very good but after the first person uses the code, the second, and third and so on users can spam the same code and get the items indefinitely. Is there a way to stop this?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

Is your script based on the example in post #13?

There is already a line that updates the SQL table when a code is redeemed.

query_sql "UPDATE `reward_codes` SET `redeem_time`=NOW(), `char_id`="+getcharid(0)+" WHERE `code`='"+escape_sql(.@pc$)+"'";
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  276
  • Reputation:   24
  • Joined:  07/06/13
  • Last Seen:  

RE: http://rathena.org/board/topic/79159-scripting-with-a-little-bit-of-sql/

would it be possible that only 1 code per person?

ex. code 1 is claimed by one player then other players wont be able to claim it anymore. hehe :)

Please do check this out, i really need help on improving the script. :)

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