Jump to content
  • 0

Question

Posted

Hello everyone!

I am currently working on a new script and decided to test the Countinarray and Inarray commands.

But for some reason, I get an error when I reach the part where it reads the countinarray command:

Line:

if (countinarray(.grbbid[0],getcharid(2)) == 1 && .grbbday[inarray(.grbbid,getcharid(2))] < 40){

Error in console:

[Warning]: Unexpected type for argument 2. Expected variable, got C_INT.
[Debug]: Data: number value=1
[Debug]: Function: countinarray
[Debug]: Source (NPC): Guild Manager at prontera (168,180)
[Error]: buildin_countinarray: not a variable
[Debug]: Data: variable name='.grbbid' index=0
[Debug]: Data: number value=1
[Debug]: Source (NPC): Guild Manager at prontera (168,180)

I downloaded rAthena from github yesterday and just compiled it with no errors.

 

Does anyone now what could it be?

3 answers to this question

Recommended Posts

  • 0
Posted (edited)

countinarray accept 2 variables [or arrays]

if you want to use this code do this


.@acc_id = getcharid(2);
if (countinarray(.grbbid[0],.@acc_id) == 1 && .grbbday[inarray(.grbbid,getcharid(2))] < 40){

 

Edited by sader1992
  • Upvote 1
  • 0
Posted

Interesting, the error makes it seem like you need a variable.

Try doing something like

.@cid = getcharid(2);
if (countinarray(.grbbid[0],.@cid) == 1 && .grbbday[inarray(.grbbid,.@cid)] < 40){

 

  • Upvote 1

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...