Jump to content
  • 0

FluxCP table CP_CREDIT configurations


Amellia sizilia sembiring

Question


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  108
  • Reputation:   4
  • Joined:  01/04/12
  • Last Seen:  

Hi, i want to integrate the flux with server database cash point. wheres the location table CP_CREDIT Query.? so i can change it with ACC_REG_NUM. i already see the field same have four field. i think just change the field name in Flux to ACC_REG_NUM field. 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  118
  • Reputation:   17
  • Joined:  01/29/15
  • Last Seen:  

Are you using it for donation purposes?

That aside, I myself have used a script to take a value from cp_credits (balance) and converted them to donation credits (could be cash points for you).

This script might help you find what you are looking for:

switch(@menu) {
		case 1:
			query_sql("SELECT `balance` FROM `" + escape_sql(.redeemTable$) + "` WHERE `account_id` = " + getcharid(3) + " LIMIT 0,30", .@credits);
			if (.@credits > 0){
			mes "How many Donation Credits do you wish to redeem?";
			next;
			mes .npcName$;
			input .@withdrawCredits,1,.@credits;
			query_sql("UPDATE `" + escape_sql(.redeemTable$) + "` SET `balance` = `balance` - " + .@withdrawCredits + " WHERE `account_id` = " + getcharid(3) + "");
			getitem 30017,.@withdrawCredits;
			mes .@withdrawCredits + "x " + getitemname(30017);
			} else {
				mes "My records indicate that there are no rewards awaiting to be redeemed.";
				mes "My deepest apologies for the misunderstanding.";
			}
		break;
		case 2:
			query_sql("SELECT `balance` FROM `" + escape_sql(.redeemTable$) + "` WHERE `account_id` = " + getcharid(3) + " LIMIT 0,30", .@credits);
			mes "You currently have " + .@credits + " donation credits.";
		break;
		case 3:
			mes "I am here to allow for the redemption of donation credits for " + .serverName$ + ".";
			mes "Donations may be made to the server via the control panel.";
		break;
		default:
			mes "Very well then.";
			mes "Good day to you.";
		break;
	}

This script is a modification of the fluxcp donation NPC and where I have getitem(30017) you should be able to add/change your cashpoints. Whether you do it by writing to another database table or making a script that runs in the background is up to you.

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