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;
}