Jump to content
  • 0

command isequipped correct use


Tassadar

Question


  • Group:  Members
  • Topic Count:  52
  • Topics Per Day:  0.02
  • Content Count:  107
  • Reputation:   5
  • Joined:  07/21/16
  • Last Seen:  

how to use the (isequipped) command to check if one of x items is equipped?

So is it the right way to do it?

if (! isequipped (13071)) {
message strcharinfo (0), "You have no equipped Upg weapon";
end;
if (! isequipped (18112)) {
message strcharinfo (0), "You have no equipped Upg weapon";
end;
if (! isequipped (21000)) {
message strcharinfo (0), "You have no equipped Upg weapon";
end;
if (! isequipped (1292)) {
message strcharinfo (0), "You have no equipped Upg weapon";
end;

I want this first check to accept any of the UPG weapons.

If any of them are equipped, npc does another check:

else if (countitem (6240) <1) {
message strcharinfo (0), "You need some ore so I can upgrade your weapon";
end;
else if (countitem (984) <1) {
message strcharinfo (0), "You need some ore so I can upgrade your weapon";
end;

Do I need to check one of the 5 UPG weapons and one ore from a list of 4 ores?

My npc will only start if any combination is hit, one of the weapons and one of the metals.

What is the correct way to do this?




 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

you could also do like this.

if (isequippedcnt(1292,13071,18112,21000) <= 0) {
	message strcharinfo (0), "You have not equipped any Upg weapon";
}
else if (countitem (6240) < 1 || countitem (984) < 1) {
	message strcharinfo (0), "You need some ores so I can upgrade your weapon";
}
else {
	// upgrage...
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.01
  • Content Count:  24
  • Reputation:   3
  • Joined:  04/10/19
  • Last Seen:  

On 6/15/2019 at 8:03 AM, Tassadar said:

how to use the (isequipped) command to check if one of x items is equipped?

So is it the right way to do it?


if (! isequipped (13071)) {
message strcharinfo (0), "You have no equipped Upg weapon";
end;
if (! isequipped (18112)) {
message strcharinfo (0), "You have no equipped Upg weapon";
end;
if (! isequipped (21000)) {
message strcharinfo (0), "You have no equipped Upg weapon";
end;
if (! isequipped (1292)) {
message strcharinfo (0), "You have no equipped Upg weapon";
end;

I want this first check to accept any of the UPG weapons.

If any of them are equipped, npc does another check:


else if (countitem (6240) <1) {
message strcharinfo (0), "You need some ore so I can upgrade your weapon";
end;
else if (countitem (984) <1) {
message strcharinfo (0), "You need some ore so I can upgrade your weapon";
end;

Do I need to check one of the 5 UPG weapons and one ore from a list of 4 ores?

My npc will only start if any combination is hit, one of the weapons and one of the metals.

What is the correct way to do this?




 

Hmm, if im not wrong isequipped support only for card ids. Not really sure, i check the script page but it seems like it mention only for cards.

i would do it in this way. havent tested yet.

switch(getequipid(EQI_HAND_R)){
	case 13071:
	case 18112:
	case 21000:
	case 1292:
		if (countitem (6240) <1 && countitem (984) < 1) {
			message strcharinfo (0), "You need some ore so I can upgrade your weapon";
		}else{
			//do your stuff here
		}
		break;
	default:
		message strcharinfo (0), "You have no equipped Upg weapon";
		break;
}

 

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