Jump to content
  • 0
Quesooo

Donation Credits exchange

Question

Good day ! ^_^ rathena

please help me with this

the functions is

  • a player go to my website > he click donations > and put donation to earn
    credit points > after that player go to log in and play ingame > now he want to
    claim her credits to a npc

  • the npc will give TCG base on credit points he have

Link to comment
Share on other sites

16 answers to this question

Recommended Posts

  • 0
15 hours ago, crazyarashi said:

i think its working no error on my putty

 

but my question now i set my credit on my website to 9999 but when i click the npc and redeem my reward or exchange it to item

 

the npc said no record indicate on her list 

Link to comment
Share on other sites

  • 0

To use that npc you need to use flux donation item mall system, so players buy items in fluxcp

 

Try this npc which we made for my server 

This npc converts fluxcp donation credits to ingame cashpoints using sql query from cp_credits

 

https://pastebin.com/wxZU9YH8

  • Upvote 2
  • Love 1
Link to comment
Share on other sites

  • 0
On 4/8/2017 at 10:15 AM, Cyro said:

To use that npc you need to use flux donation item mall system, so players buy items in fluxcp

 

Try this npc which we made for my server 

This npc converts fluxcp donation credits to ingame cashpoints using sql query from cp_credits

 

https://pastebin.com/wxZU9YH8

+1 thank you its working ^^

 

by the way do i change it to credits to TCG? thank you

Link to comment
Share on other sites

  • 0
15 hours ago, Cyro said:

Change 

Set #cashpoints to

Getitem itemid

i also cant find it please modify the script 1 credit = 1 tcg thank you ^_^

 

also please remove the color codes on script

Link to comment
Share on other sites

  • 0
prontera,255,255,5	script	Cash Points Exchanger	758,{
set .@i, #CASHPOINTS;
mes "[Cashpoints Exchanger]";
mes "You have ^0055FF"+.@i+" Cash Points^000000.";
if (!.@i) { mes "Please come back later."; close; }
mes "I can convert your ^FF0000Cash Points^000000 To a ^FF0000TCG^000000.";
next;
if(select(" - Trade: - ^777777Leave^000000")==2) close;
mes "[Cashpoints Exchanger]";
mes "How many would you like to convert?";
next;
input .@j;
mes "[Cashpoints Exchanger]";
if (.@j < 1 || .@j > #CASHPOINTS) { mes "That's an invalid amount."; close; }
mes "Are you sure you want to exchange ^0055FF"+.@j+" Cashpoints^000000?";
if(select(" - Yes: - No")==2) close;
mes " ";
set #CASHPOINTS, #CASHPOINTS-([email protected]*1);
getitem 7227, .@j;
mes "You now have "+countitem(7227)+" TCG.";
close;
}

Cashpoints to TCG
 

  • Upvote 1
Link to comment
Share on other sites

  • 0
15 hours ago, crazyarashi said:
prontera,255,255,5	script	Cash Points Exchanger	758,{
set .@i, #CASHPOINTS;
mes "[Cashpoints Exchanger]";
mes "You have ^0055FF"+.@i+" Cash Points^000000.";
if (!.@i) { mes "Please come back later."; close; }
mes "I can convert your ^FF0000Cash Points^000000 To a ^FF0000TCG^000000.";
next;
if(select(" - Trade: - ^777777Leave^000000")==2) close;
mes "[Cashpoints Exchanger]";
mes "How many would you like to convert?";
next;
input .@j;
mes "[Cashpoints Exchanger]";
if (.@j < 1 || .@j > #CASHPOINTS) { mes "That's an invalid amount."; close; }
mes "Are you sure you want to exchange ^0055FF"+.@j+" Cashpoints^000000?";
if(select(" - Yes: - No")==2) close;
mes " ";
set #CASHPOINTS, #CASHPOINTS-([email protected]*1);
getitem 7227, .@j;
mes "You now have "+countitem(7227)+" TCG.";
close;
}

Cashpoints to TCG
 

thank you ^_^

Link to comment
Share on other sites

  • 0
prontera,144,171,6  script  Donation Manager    89,{
 
    mes "[Jimmy John]";
    mes "Would you like to convert your Donation Credit to TcG";
    mes "Exchange Rate:";
    mes "^0000FF1^000000 Donation Credit = one TCG";
    next;
    set @dCreds,query_sql("SELECT `balance` FROM cp_credits WHERE `account_id` = "+getcharid(3)+";",.@dCreds);
    mes "Please select the service you want:";
    next;
    menu "^FF0000Exchange",dpExc,"^0000FFCheck  Points/Credits",checkPoints,"^00FF00Quit",LeEnd;
   
    dpExc:
        mes "Available Cash Point to Exchange from Donation Credit : ^0000FF" + .@dCreds + "^000000";
        next;
        mes "How many ^FF0000 Cash Point ^000000 do you want?";
        input @ExchangeECd;
        if (.@dCreds < @ExchangeECd) goto ENeedDcredits;
        mes "That will be ^0000FF" + @ExchangeECd + "^000000 Donation Credits!";
        menu "Yes, I am sure.",LEyesd,"I will decide later...^000000",LEno;
        LEyesd:
        set .@dCBal,.@dCreds-@ExchangeECd;
        query_sql("UPDATE `cp_credits` SET `balance` = "+.@dCBal+" WHERE account_id = "+getcharid(3)+";");
        getitem 7227,@ExchangeECd;
        next;
        goto Edis2;
        close;     
    LEno:
        mes "Thanks you ^0000FF" + strcharinfo(0) + "^000000!";
        mes "And done come again!";
        close;
       
    Edis2:
        mes "Your Donation Credit = ^0000FF" + .@dCBal + "^000000!";
        mes "Your Cash Point = ^0000FF" + #CASHPOINTS + "^000000! ";
        close;
       
    ENeedDcredits:
        mes "Sorry, you don't have enough Donation Credits.";
        close;
       
    checkPoints:
        mes "Your Donation Credit = ^0000FF" + .@dCreds + "^000000!";
        mes "Your Cash Point = ^0000FF" + #CASHPOINTS + "^000000! ";
        close;
 
    LeEnd:
        close; 
       
       
    OnInit:
    waitingroom "Redeem Donation",0;
    end;
 
}

 

  • Upvote 1
Link to comment
Share on other sites

  • 0
On 4/9/2017 at 1:15 AM, Cyro said:

To use that npc you need to use flux donation item mall system, so players buy items in fluxcp

 

Try this npc which we made for my server 

This npc converts fluxcp donation credits to ingame cashpoints using sql query from cp_credits

 

https://pastebin.com/wxZU9YH8

@Cyro how to make it change 1 Donation Credits to 1000 Cash Point ?

Link to comment
Share on other sites

  • 0
16 minutes ago, mrfizi said:

@Cyro how to make it change 1 Donation Credits to 1000 Cash Point ?

set #CASHPOINTS,#[email protected];
to
set #CASHPOINTS,#CASHPOINTS + (@ExchangeECd*1000);

 

  • Love 1
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...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.