Jump to content
  • 0

Countinarray not working


Tomahawk

Question


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  27
  • Reputation:   7
  • Joined:  07/17/18
  • Last Seen:  

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?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   703
  • Joined:  12/21/14
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  141
  • Reputation:   45
  • Joined:  08/14/12
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  27
  • Reputation:   7
  • Joined:  07/17/18
  • Last Seen:  

Thank you very much, solved!

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