Jump to content
  • 0

Checking players card and inventory


Radian

Question


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

Hey guys, Im having trouble with this and I've been trying to fix it and make it work as what i wanted, but i failed.

On this part, what I want to achieve is to check each player if they have the specific potion that is restricted while entering the area.

					for ( .@i = 0; .@i < getarraysize(.Potions); .@i++ ) {
						if(checkcart()) {
							if(cartcountitem(.Potions[.@i]) >= 1){
								mes "Please remove the restricted items from your inventory and cart.";
								close;
							}
						} else if(countitem(.Potions[.@i]) >= 1) {
								mes "Please remove the restricted items from your inventory and cart.";
								close;
							}
					}

So far the result is when Player have a cart its working but it will ignore the inventory check.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  91
  • Reputation:   22
  • Joined:  10/24/14
  • Last Seen:  

Hey,

Remove else from the if statement so it will check both, cart and inventory.
 

Quote

} else if(countitem(.Potions[.@i]) >= 1) {

 

Edited by Sehrentos
Fix typo2
  • Love 1
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...