Jump to content

Recommended Posts

Posted

@tron

A lil typo..

Replace:

mes "You get ^0000FF" + getitemname(@available_item[@i]) + " - " + @available_item[@i] + " ea.^000000";

to

mes "You get ^0000FF" + getitemname(@available_item[@i]) + " - " + @available_amount[@i] + " ea.^000000";

Posted

@tr0n

I got a problem while giving out the codes to the players as an event for a test. I just input the "amount" from 10 and I made lots of Coupon Codes. Then suddenly some of my players got atleast 400~500 amount of the item I input.

if i was right.....then i think those player are using this method to achieve above situation...

  • GM Generate Coupon for Items and give the Code to Players.
  • Players gain items from the NPC by giving the right Code.
  • but then...unfortunately.....they found a way to Duplicate your Items / Coupons...
  • this is the way how they do it....
  • Give the Correct Code , then get items. before they Close the Message Window .... they ...Relog / ALT + F4

so....after they relog / Alt +F4 ......the Coupon actually is not deleted from the SQL. ....because...the command line that delete the SQL only executed right after they closed the message window of NPC.

mes "[^FF7700Coupon Jack^000000]";
mes "You get ^0000FF" + getitemname(@available_item[@i]) + " - " + @available_item[@i] + " ea.^000000";
close2;
query_sql "DELETE FROM `coupons` WHERE `code`='"+@my_code$+"'";
getitem @available_item[@i],@available_amount[@i];
end;

if you want...you can try it like this...i think it should be able to solve above problems.


mes "[^FF7700Coupon Jack^000000]";
mes "You get ^0000FF" + getitemname(@available_item[@i]) + " - " + @available_item[@i] + " ea.^000000";
query_sql "DELETE FROM `coupons` WHERE `code`='"+@my_code$+"'";
getitem @available_item[@i],@available_amount[@i];
close;

and....make sure you dont generate alot Coupon with SAME Code.

I also monitored my SQL, and it has been deleted right away. In just a few minutes, after that I got reports that players got 400~500 amount.

ya...the query will be delete if player click on "Close" button to close the NPC Message.

Emistry, how it can be that you get the item before it gets deleted in sql ? the query is before getitem.

Does the query need a bit of time ?

erm..i was refer the close2 command you using. because you run the query deletion line right after....

aw....i just now only saw what tr0n try to tell me ..... >.<

you get item only after the query is deleted... >.< swt i missed this...LOL...

erm...

Posted

2 tips:

- that label isn't really necessary, would look nicer if you used {}

- why don't you set the variables on the OnInit label instead of setting them everytime the user clicks the npc?

Posted

@Emistry

how could this be bugged then when the query deletes the data before it gets the item ?

2 tips:

- that label isn't really necessary, would look nicer if you used {}

- why don't you set the variables on the OnInit label instead of setting them everytime the user clicks the npc?

- would look nicer ? it checks '@coupon_item' 2 times so I would need to write it down again. that's why I use label to avoid this.

That's better. And why I shouldn't use a label ?

- that's just a style of me. But yea you're right. Would be better if I put it in OnInit.

Posted

+1 the latest is still abuse, when i input the code and after i got it, and i input it again it still continueing giving me a Main Guachce #1207

Is there any problem with the script tr0n?

Thanks for this!

Posted

Hehe, you can do it ! The script you made is awesome <3 Good for implementing Donation Codes or anything XD THANKS FOR THE RELEASE & I hope some bugs will be fixed soon...

Suggestion : Just remove the last message of the script "mes" i think..

Posted

Im not a pro in script but i already fix the bug, i am using simple script lets check this.

Find

if(@my_code$==@available_code$[@i])

{

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];

close;

}

Replace this

if(@my_code$==@available_code$[@i])

{

mes "[^FF7700Coupon Jack^000000]";

mes "After you enter the code you will be disconnect in 3 secs.";

next;

mes "[^FF7700Coupon Jack^000000]";

mes "3.";

next;

mes "[^FF7700Coupon Jack^000000]";

mes "2.";

next;

mes "[^FF7700Coupon Jack^000000]";

mes "1.";

next;

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];

atcommand "@kick " +strcharinfo(0);

close;

}

Posted (edited)

Refresh is not working. on my mind this code query_sql "DELETE FROM `coupons` WHERE `code`='"+@my_code$+"'"; will be effect if you are going to character select.

Why dont you try.

Edited by Khaii
Posted

I uploaded it again with changes:

{
  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$+"'";
  sleep2 3000;
  close2;
  getitem @available_item[@i],@available_amount[@i];
  end;
}

this should work maybe.

Posted

@tr0n

Maybe try making it a delay.. Receiving in 3-2-1.. then the dialog box closes then the item will be received something like that sir. The code is being abused on what sir Emistry said, character select or warping in its place..

Posted

Nope script working fine. this is posible bug

For example ill add the code then after input the code they give me item, then ill try twice input they will give me again item.

Join the conversation

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

Guest
Reply to this topic...

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...