Jump to content

Custom cash shop


Recommended Posts


  • Group:  Members
  • Topic Count:  55
  • Topics Per Day:  0.01
  • Content Count:  206
  • Reputation:   13
  • Joined:  11/20/11
  • Last Seen:  

Patulong naman po. Ginamit ko yung Custom Cash Shop by @Ind after ng pag recompile ko wala naman error pero pag bibili na ako sa cash shop hindi dinedelete yung item na kelangan :<

Help please </3 Thank you in advance!

topic from eA: Link

Here's the diff.

if( stristr(nd->name,"ITMCur") ) {//Item Currency
int count=0,ind=0,c = 0, cid = pc_readreg(sd,add_str("@RRITMCur"));
for(c = 0; c < MAX_INVENTORY; c++)
if(sd->status.inventory[c].nameid == cid)
count += sd->status.inventory[c].amount;
if( count != pc_readaccountreg( sd, "#CASHPOINTS" ) )
return 6;
ind = pc_search_inventory(sd,cid);
if( ind < 0 )//because checking twice is safer...
return 6;
sd->cashPoints = count;
if( sd->cashPoints < price )
return 6;
if( pc_delitem(sd,ind,price,0,0, LOG_TYPE_NPC) )//somehow it failed to delete...
return 6;
sd->cashPoints -= price;
if( !pet_create_egg(sd, nameid) )
{
	struct item item_tmp;
	memset(&item_tmp, 0, sizeof(struct item));
	item_tmp.nameid = nameid;
	item_tmp.identify = 1;

	pc_additem(sd,&item_tmp, amount, LOG_TYPE_NPC);
}
if(log_config.enable_logs&0x20)
log_pick_pc(sd, LOG_TYPE_SCRIPT, amount, NULL);
pc_setaccountreg(sd,"#CASHPOINTS",sd->cashPoints);//update shop~
return 0;
}
if( stristr(nd->name,"CharCur") ) {//Char Reg Currency (from set REGNAME,1;)
const char* charReg = pc_readregstr(sd,add_str("@CharCurrrency$"));
int count = pc_readglobalreg(sd,charReg);
if( count != pc_readaccountreg( sd, "#CASHPOINTS" ) )//safecheck
return 6;
sd->cashPoints = count;
if( sd->cashPoints < price )
return 6;
sd->cashPoints -= price;
pc_setglobalreg(sd,charReg,sd->cashPoints);//update...
if( !pet_create_egg(sd, nameid) )//give item...
{
	struct item item_tmp;
	memset(&item_tmp, 0, sizeof(struct item));
	item_tmp.nameid = nameid;
	item_tmp.identify = 1;

	pc_additem(sd,&item_tmp, amount, LOG_TYPE_NPC);
}
if(log_config.enable_logs&0x20)
log_pick_pc(sd, LOG_TYPE_SCRIPT, amount, NULL);
pc_setaccountreg(sd,"#CASHPOINTS",sd->cashPoints);//update shop~
return 0;
}
if( stristr(nd->name,"ACCCur") ) {//Account Reg Currency
const char* charReg = pc_readregstr(sd,add_str("@AccCurrrency$"));
int count = pc_readaccountreg(sd,charReg);
if( count != pc_readaccountreg( sd, "#CASHPOINTS" ) )//safecheck
return 6;
sd->cashPoints = count;
if( sd->cashPoints < price )
return 6;
sd->cashPoints -= price;
pc_setaccountreg(sd,charReg,sd->cashPoints);//update...
if( !pet_create_egg(sd, nameid) )//give item...
{
	struct item item_tmp;
	memset(&item_tmp, 0, sizeof(struct item));
	item_tmp.nameid = nameid;
	item_tmp.identify = 1;

	pc_additem(sd,&item_tmp, amount, LOG_TYPE_NPC);
}
if(log_config.enable_logs&0x20)
log_pick_pc(sd, LOG_TYPE_SCRIPT, amount, NULL);
pc_setaccountreg(sd,"#CASHPOINTS",sd->cashPoints);//update shop~
return 0;
}

Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  80
  • Topics Per Day:  0.02
  • Content Count:  325
  • Reputation:   76
  • Joined:  03/22/12
  • Last Seen:  

use this script

prontera,150,150,4<tab>cashshop<tab>,Cash Points<tab>89,ITEM ID:PRICE;
Edited by eJay
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  154
  • Reputation:   6
  • Joined:  04/26/12
  • Last Seen:  

mas okay gamitin to

http://pastebin.com/raw.php?i=G7pt6HR7

pwedeng points or specific item, momodify mo nalang yung script. /no1

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
Reply to this topic...

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