Jump to content
  • 0

Checking players card and inventory


Question

Posted

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.

1 answer to this question

Recommended Posts

  • 0
Posted (edited)

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

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