Jump to content
  • 0

Code - for one time claiming


Drinna

Question


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  33
  • Reputation:   1
  • Joined:  06/07/17
  • Last Seen:  

Hi, 

I would like to see if anyone can help me with a script I'm working on. 

I am pretty much a beginner and I have been able to find out that there are ways for you to create an NPC that will allow you to set codes for players to claim. I studied them but not much made sense as I don't understand SQL scripting just yet. 

However with my primitive knowledge, I was able to devise a much simpler version, something that I can understand and is within my scripting level. 

but I can't seem to know what commands I ought to type so that when a code I set is claimed by 1 player, then it wouldn't be available to be claimed by other players. 

Hope anyone can help! ? 

Edited by Drinna
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  234
  • Reputation:   113
  • Joined:  02/24/15
  • Last Seen:  

If you shared the script, it would be easier to help.

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

store some helpful info that allow your script to check it, so that the script could tell if there already exists someone claimed it before.

ex. store a value into a variable/database, and have the script check for it when another player try to claim it.

 

sample like freebie script are your easy target for references.

Edited by Emistry
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  33
  • Reputation:   1
  • Joined:  06/07/17
  • Last Seen:  

2 hours ago, maken06 said:

If you shared the script, it would be easier to help.

Hi ! Yeah I was thinking about that I will have it posted below

alberta,148,60,3    script    V-Code Manager    833,{
set .v$,"";

if(getgroupid() == 99) {
mes .v$,"Greetings, Please enter your passcode.";
next;
input .@security;
if(.@security == 6969){
mes .v$,"Hi, Admin! Welcome!";
mes "Be ready to have the Vcode";
mes "for new top ups.";
next;
mes .v$,"Ready to enter code?";
next;
switch(select("Enter Promo Code:Cancel")) {

case 1:

mes .v$,"Input Code";
input .@topupcode$;
next;
mes .v$,"Input Reward";
input .@topupitem;
next;
mes .v$,"Input Amount";
input .@amt;
mes "Please make a quick review..";
mes "Promo Code: ^880000"+.@topupcode$+"^000000";
mes "Promo Reward: ^000088"+getitemname(.@topupitem)+" "+.@amt+"x^000000";
while(select("Confirmed:Ugh, I change my mind.")== 2){
mes .v$,"Okay then,See ya!";
close;
}
$Promo$ = .@topupcode$;
$PromoItem = .@topupitem;
$PromoAmt = .@amt;
$PromoAct = 1;
$PromoNum++;
next;
mes .v$,"VCode is now ready for claiming!";
close;
break;

case 2:

mes .v$,"Alright then you might";
mes "need some time. Goodbye!";
close;
break;
}

}

mes .v$,"I'm sorry wrong passcode.";
mes "Try again.";
close;

}


mes .v$,"Welcome! I manage V-codes";
mes "for players who purchased";
mes "in game Cash Points.";
next;
mes .v$,"Cash Points can be used";
mes "in Kafra Shops to buy";
mes "equipments and usable items.";
next;
mes .v$,"Do you have a V-code";
mes "you purchased?";
menu "Enter 16 Digit V-code",L_Claim,"What to do with Vcodes?",V_Explain,"Nope, Just passing by..",Good_B;
close;

L_Claim:
next;
mes .v$,"Enter your Top Up V-Code here";
mes "Please do not leave the DASHES";
mes "example below :";
mes "XXXX-XXXX-XXXX-XXXX";
input .@pcode$;
if(.@pcode$ == $Promo$ && $PromoAct != 0 && ##Claimed != $PromoNum){
next;
mes .v$,"Thanks for your purchase";
next;
mes .v$,"Please accept it.";
getitem $PromoItem,$PromoAmt;
set ##Claimed,$PromoNum;
close;

}
else{
next;
mes .v$,"Sorry, The code you have";
mes "entered is either invalid";
mes "or have already been used";
mes "please try again, or";
mes "contact our FB page";
mes "for assistance";
close;

}

V_Explain:
next;
mes .v$,"Vcodes can get you";
mes "specific number of vouchers,";
mes "and you can get them";
mes "be exchanged for Cash Points";
mes "you can talk to the lady";
mes "on my left to know more.";
close;

Good_B:
next;
mes .v$,"Okay then, Thanks for your time!";
close;
}

 

The problem with that one above ^ is that it only stores 1 code at a time, I was wanting it to store as much codes possible, and the code could be used only one time, and will be unclaimable by any other players or any other characters in the players account, kinda like a one time use ticket in a cinema, once a staff tore it, then it's used.

 

1 hour ago, Emistry said:

store some helpful info that allow your script to check it, so that the script could tell if there already exists someone claimed it before.

ex. store a value into a variable/database, and have the script check for it when another player try to claim it.

 


Thanks for that emistry , the only prob I get with the freebies scriptings is another character from another account can use the code again. 

I'm sorry for being such a newbie. I tried reading stuff but I guess I can only do so much and I just needed to ask for help. 

 

Edited by Emistry
Please use codebox.
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...