Jump to content
  • 0

IsEquipped more than 1 item


caspa

Question


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

hi guys, just a quick question.
how do i add more items on the isequipped part on the code?

i tried doing it like this but i got error =  " if(pc_isequipped(sd, 23111,23112,23113,23114 and so on.... )){ "

i don't want to do it by putting the same code below the first code with the item 23112 because the items goes beyond 23140 so i would just like to simplify it if possible.

thx guys.. ?


            if(pc_isequipped(sd, 23111)){
            clif_displaymessage(sd->fd, "Can't attack while on Mount.");
            unit_stop_attack(src);
            return 0;
        }

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  36
  • Topics Per Day:  0.01
  • Content Count:  220
  • Reputation:   251
  • Joined:  04/08/13
  • Last Seen:  

for( i = 0; i < 29; i++ ) {
	if (pc_isequipped(sd, 23111+i)) {
		clif_displaymessage(sd->fd, "Can't attack while on Mount.");
		unit_stop_attack(src);
		return 0;
	}
}

Not tested.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

1 hour ago, Easycore said:

for( i = 0; i < 29; i++ ) {
	if (pc_isequipped(sd, 23111+i)) {
		clif_displaymessage(sd->fd, "Can't attack while on Mount.");
		unit_stop_attack(src);
		return 0;
	}
}

Not tested.

it doesn't work... i'm getting so much error... i'm using 3ceam by the way.. ?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  36
  • Topics Per Day:  0.01
  • Content Count:  220
  • Reputation:   251
  • Joined:  04/08/13
  • Last Seen:  

1 hour ago, caspa said:

it doesn't work... i'm getting so much error... i'm using 3ceam by the way.. ?

At least post what errors did you get, besides you should ask in 3ceam forum.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

9 hours ago, Easycore said:

At least post what errors did you get, besides you should ask in 3ceam forum.

i don't think there a 3ceam forum anymore.. ?

Link to comment
Share on other sites

  • 0

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

why would you think this pc_isequipped(sd, 23111,23112,23113,23114 and so on) would work on ?

bool pc_isequipped(struct map_session_data *sd, unsigned short nameid);

so your code should be like this

if(pc_isequipped(sd, 23111) && pc_isequipped(sd, 23112) && pc_isequipped(sd, 23113))	//etc
{

}

 

Edited by sader1992
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  1
  • Reputation:   0
  • Joined:  04/01/23
  • Last Seen:  

He can do it by two methods:

if(pc_isequipped(sd, 23111) && pc_isequipped(sd, 23112) && pc_isequipped(sd, 23113))

Here all the items should be equipped to trigger the next steps.

Or

 

if(pc_isequipped(sd, 23111) || pc_isequipped(sd, 23112) || pc_isequipped(sd, 23113))

Here any one of the item if equipped can trigger the next steps.

Edited by shakaal
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...