Jump to content
  • 0

Ingame Donation Credit convert into Cash Points


rakuzas

Question


  • Group:  Members
  • Topic Count:  152
  • Topics Per Day:  0.03
  • Content Count:  459
  • Reputation:   7
  • Joined:  06/29/12
  • Last Seen:  

Ok.. Do any scripts like this?

 

1. People already donate into my CP.. Then they receive Donation Credit or Donation Points..

2. He/She then login in game.. Then talk to this NPC.

3. Then the NPC will change is Donation Credit into Cash Points.

 

I found this script.. Try to edit it but it cannot works.. Hmmm.. Or does this kind of NPC im request is already exist? Hope will have good news..

 

Here is the script i mention..

 

//===== eAthena Script ======================================================================
//= Donation System
//===== Original By =========================================================================
//= Hellflaem
//===== Credit =========================================================================
//= Hellflaem , Martin Angelov from tutorialzine.com
//===== Current Version: ====================================================================
//= 3.0
//===== Compatible With: ====================================================================
//= Any eAthena
//===== Description: ========================================================================
//= An Ingame Npc that can add Cash points to players online or offline.Also lets player view there cash points ingame.
//= An Out of game fully auto php $ paypal IPN based donation system.
//= Players donate for cash points at the donation center from you website.
//= Lists player how have donated, there is an Admin page as well.
//= Which lets admins add cash points to an account and list the last 5 donatons made.
//===== Comments================================================================
//= Please give Credit if you use this!!!
//===========================================================================================

prontera,168,178,4	script	Points Viewer	86,{
set $currency$,"Dollar";
set .name$, "[^0080FFPoints Viewer^000000]";

mes .name$;
if(getgmlevel() >= 99) {
	mes "Hello "+strcharinfo(0);
	mes "What can I help you with today?";
	next;
	if (select("Add Cash Points:Nothing") == 2) close;
	mes .name$;
	mes "Please remember if the player is online they will have to relog.";
	next;
	mes .name$;
	mes "What is the ^FF0000Account Id?^000000 I should add the funds to?";
	input @account_id;
	next;
	mes .name$;
	mes "Now, what is the amount of ^FF0000Cash Points^000000 I should add?";
	input @points_to_add;
	next;
	mes .name$;
	mes "Please check if the following information is right:";
	mes "Account Id: ^FF0000"+@account_id+"^000000";
	mes "Cash Points to add: ^FF0000"+@points_to_add+" "+$currency$+"^000000";
	next;
	if (select("Yes:No") == 2) close;

	mes .name$;
mes "I have added ^FF0000"+@points_to_add+" "+$currency$+"^000000 to the Account Id. ^FF0000"+@account_id$+"^000000";
	query_sql "INSERT INTO `cash_points` VALUES ('"+@account_id+"','"+@points_to_add+"')";
	close;

} else {

	mes "Hello "+strcharinfo(0);
	mes "And you have "+#CASHPOINTS+" Donation Points.";
	close;
}
}
-	script	CashPointsUpdater	-1,{

// Every Time Player Logins
OnPCLoginEvent:

// Delete Result Array (If Any)
// if (getarraysize(@points_to_add) >= 1) { deletearray @points_to_add,127; }

// Query Database And See If There
// Are Points Waiting To Be Added
set @nb,query_sql("SELECT `points_to_add` FROM `cash_points` WHERE (`account_id` = "+ getcharid(3) +") LIMIT 1",
        @points_to_add);

// Proceed If A Result Row Is Found and
// Check If Points To Add Is Greater Than or Equal To 1      
if ((@nb == 1) && ((@points_to_add >= 1)))
{
    // Update User's Points
    set #CASHPOINTS,(#CASHPOINTS + @points_to_add);
        
    // Update Cash Points Table  
    set @nb,query_sql ("DELETE FROM `cash_points` WHERE (`account_id` = "+ getcharid(3) +") LIMIT 1");

    // Let Player Know Points Updated
    mes "^008000[ Server ]^000000";
    mes " ";
    mes "Your Donation Credit Points has been successfully updated. Your new balance is ...";
    mes " ";
    mes "Donation Credit Points : ^0000FF"+ #CASHPOINTS +"^000000";
    close;
}

// The End
end;

}

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   241
  • Joined:  09/05/12
  • Last Seen:  

Use this :

 

#CASHPOINTS = #CASHPOINTS + <amount>;
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  152
  • Topics Per Day:  0.03
  • Content Count:  459
  • Reputation:   7
  • Joined:  06/29/12
  • Last Seen:  

Sir,

 

Edit at this line? 

 

// Update User's Points
    set #CASHPOINTS,(#CASHPOINTS + @points_to_add);

Also.. at my console, shows error said "cash_points" not found in my database.. 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   241
  • Joined:  09/05/12
  • Last Seen:  

Ah didn't see the #CASHPOINTS on your script. Anyway i think you didn't import the `cash_points` table on your database. And i guess you don't need to use SQL for repository of your cashpoints since you can found them on global_reg_value table. 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  152
  • Topics Per Day:  0.03
  • Content Count:  459
  • Reputation:   7
  • Joined:  06/29/12
  • Last Seen:  

Hmmm.. So.. What thing to do to make this script works?  I did try change that "cash_points" into global_reg_valur or cp_credit but still not working..

 

Or any scripts similar like this.. I mean.. The script that enable donating player convert their donationg credit into cash points ingame..

 

 

 

 

Note : Im using calciumkid flux cp.. But i have buying problem.. i already open new topic regarding this matter but still no reply.. Anybody have experience this problem? LINK

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  65
  • Reputation:   0
  • Joined:  04/12/12
  • Last Seen:  

Hmmm.. So.. What thing to do to make this script works?  I did try change that "cash_points" into global_reg_valur or cp_credit but still not working..

 

Or any scripts similar like this.. I mean.. The script that enable donating player convert their donationg credit into cash points ingame..

 

 

 

 

Note : Im using calciumkid flux cp.. But i have buying problem.. i already open new topic regarding this matter but still no reply.. Anybody have experience this problem? LINK

do you have any solution for this? can share with me ?

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