#1

Код:
if (!Inventory_HasItem(playerid, "Weapon License A") || !Inventory_HasItem(playerid, "Weapon License B") || !Inventory_HasItem(playerid, "Weapon License C")
		                return SendErrorMessage(playerid, "You are not allowed to purchase from here without a weapon license.");
Should be working like, if you don't have license A, it should see if you don't have B and then it should check if you don't have C. If you don't have it should print the error. But in-game I can buy the item with Weapon License C ONLY, not with A or B.

Help with fixing that, no any errors while compiling.
Reply
#2

change all of your || to && so it should look like this:
PHP код:
if (!Inventory_HasItem(playerid"Weapon License A") && !Inventory_HasItem(playerid"Weapon License B") && !Inventory_HasItem(playerid"Weapon License C")
                        return 
SendErrorMessage(playerid"You are not allowed to purchase from here without a weapon license."); 
Explanation: You're checking if the player doesnt have A OR B OR C which means in order to get past this returned block he must have ALL 3, and you want him to pass if he has 1 so you must do if he doesnt have A AND B AND C instead of OR (||) we put (&&) that should solve it.
Reply
#3

just make 3 if statements and see
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)