Jump to content
  • 0

rathena don't have cartcountitem script command?


XenaNyx

Question


  • Group:  Members
  • Topic Count:  37
  • Topics Per Day:  0.01
  • Content Count:  131
  • Reputation:   8
  • Joined:  02/08/12
  • Last Seen:  

i use old npc for eathena to check item in player cart but i can't use this npc with rathena

how to check item in cart like eathena?

hope this feature add to rathena server

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  713
  • Reputation:   70
  • Joined:  11/08/11
  • Last Seen:  

that command isn't even in eAthena, it is just a source mod, you need to apply it into rAthena in order to use it

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  37
  • Topics Per Day:  0.01
  • Content Count:  131
  • Reputation:   8
  • Joined:  02/08/12
  • Last Seen:  

really? i think it's have in eathena, maybe i forgot it

i find in script.c

/*================================================
* Check how many items/cards in the list are
* in the user's cart [Zohan]
*------------------------------------------------*/
BUILDIN_FUNC(cartcountitem)
{
int nameid, i;
int count=0;

struct script_data *data;
TBL_PC* sd = script_rid2sd(st);
if (!sd) {
script_pushint(st,0);
return 0;
}

data = script_getdata(st,2);
get_val(st,data);
if( data_isstring(data) ) {
const char* name = conv_str(st,data);
struct item_data* item_data;
if((item_data = itemdb_searchname(name)) != NULL)
nameid = item_data->nameid;
else
nameid = 0;
} else
nameid = conv_num(st,data);

if (nameid < 500) {
ShowError("wrong item ID : countitem(%i)n", nameid);
script_reportsrc(st);
script_pushint(st,0);
return 1;
}
for(i = 0; i < MAX_CART; i++)
{

if(sd->status.cart[i].nameid == nameid)
{
count += sd->status.cart[i].amount;
}
}
script_pushint(st,count);
return 0;
}

BUILDIN_DEF(cartcountitem,"i"),

thx for answer

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