yuhsing

Untitled

Dec 22nd, 2012
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.52 KB | None | 0 0
  1.  
  2.  
  3. /*
  4. CREATE TABLE IF NOT EXISTS `E-Donation` (
  5. `id` int(11) NOT NULL auto_increment,
  6. `donor_name` varchar(30) NOT NULL default '',
  7. `item` tinyint(3) unsigned NOT NULL default '0',
  8. `status` tinyint(2) NOT NULL default '0',
  9. PRIMARY KEY (`id`)
  10. ) ENGINE=MyISAM;
  11. */
  12.  
  13. prontera,155,171,5 script Donation Claimer 757,{
  14. mes "This is where you claim POD Tickets from DONATIONS. Remember to use your MAIN CHARACTER you indicated in your DONATION EMAIL or FAX when talking to me. All Donations are process everyday";
  15. next;
  16. switch( select( "Claim Donation",( getgmlevel() < 0 )?"":"Add New Donor" ) ){
  17. Case 1:
  18. if( query_sql( "SELECT `item` FROM `E-Donation` WHERE `donor_name`='"+escape_sql(strcharinfo(0))+"' AND `status` = '0'",.@item ) ){
  19. mes "Claim all donation items ?";
  20. for( set .@i,0; .@i < getarraysize( .@item ); set .@i,.@i + 1 )
  21. mes "^777777"+.donation$[.@item[.@i]]+"^000000";
  22. if( select("Claim All:Cancel") == 1 ){
  23. for( set .@i,0; .@i < getarraysize( .@item ); set .@i,.@i + 1 )
  24. switch( .@item[.@i] ){
  25. Case 0: getitem 7227,1; break; // Donation 1
  26. Case 1: getitem 7227,3; break; // Donation 2
  27. Case 2: getitem 7227,4; break; // Donation 3
  28. Case 3: getitem 7227,2; break; // Donation 4
  29. Case 4: getitem 7227,2; break; // Promotion 1
  30. Case 5: getitem 7227,2; break; // Promotion 2
  31. default:
  32. debugmes "Error Donation Item Code # "+.@item[.@i]+"";
  33. break;
  34. }
  35. query_sql( "UPDATE `E-Donation` SET `status`='1' WHERE `donor_name`='"+escape_sql(strcharinfo(0))+"' AND `status` = '0'" );
  36. }
  37.  
  38. }else{
  39. mes "Sorry, you don't have any POD on pending.";
  40. }
  41. break;
  42.  
  43. Case 2:
  44. mes "Please input new Donor Char name :";
  45. input .@name$;
  46. set .@donation,select( .donation_menu$ ) - 1;
  47. next;
  48. mes "Donor Name : ";
  49. mes "^0055FF ~ "+.@name$+"^000000";
  50. mes "Donation Item : ";
  51. mes "^0055FF ~ "+.donation$[.@donation]+"^000000";
  52. if( select("Confirm:Cancel") == 1 ){
  53. mes "Added Successfully.";
  54. query_sql( "INSERT INTO `E-Donation` ( `donor_name`,`item` ) VALUES ( '"+escape_sql(.@name$)+"','"+.@donation+"' ) ");
  55. }
  56. default: break;
  57. }
  58. close;
  59.  
  60. OnInit:
  61. waitingroom "Claim your Donation here",0;
  62.  
  63. // donation name
  64. setarray .donation$[0],"Donation 1","Donation 2","Donation 3","Donation 4","Promotion 1","Promotion 2";
  65.  
  66.  
  67. // dont edit belows...
  68. set .donation_size,getarraysize( .donation$ );
  69. for( set .@i,0; .@i < .donation_size; set .@i,.@i + 1 )
  70. set .donation_menu$,.donation_menu$ + .donation$[.@i] + ":";
  71. end;
  72.  
  73. }
Advertisement
Add Comment
Please, Sign In to add comment