Forum Jump :

Author Message


Posts: 7
Rank:


Level: Member

Country: es
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2017-11-29 19:38        
     
Hi, im doing a script, and I have a question, the player needs to have an item and I want him to have it out of the code if he does not have it, how to verify if the player has that item?
It's if (player doesnt have the item) exitWith {hint "You don't have X item"};



[mod edit]
silly all caps title replaced.

This post was edited by Foxhound (2017-11-29 19:52, 228 days ago)


Author Message


Posts: 136
Rank:


Level: Member

Country: us
Location: Pennsylvania
Occupation:
Age:
In-game name: Xian

 
#2 Posted at 2017-11-30 09:37        
     
Courtesy of Shadler17 from this post Here.



_items = items player;
if ("ToolKit" in _items) then {
// script
};


Or if you need magazines, courtesy of Ranwer135:

"ItemClassName" in magazines player;


Advertisement


Author Message


Posts: 7
Rank:


Level: Member

Country: es
Location:
Occupation:
Age:
In-game name:

 
#3 Posted at 2017-11-30 18:54        
     
# XianGrim : Courtesy of Shadler17 from this post Here.



_items = items player;
if ("ToolKit" in _items) then {
// script
};


Or if you need magazines, courtesy of Ranwer135:

"ItemClassName" in magazines player;

Can I use in this way?
_items = items player;
if (!"ToolKit" in _items) exitWith {};


Author Message


Posts: 136
Rank:


Level: Member

Country: us
Location: Pennsylvania
Occupation:
Age:
In-game name: Xian

 
#4 Posted at 2017-12-01 06:42        
     
Try it. If that doesn't work, it might be:

_items = items player;
if (!("ToolKit" in _items)) exitWith {};

Not home to test so try it and see.


Author Message


Posts: 7
Rank:


Level: Member

Country: es
Location:
Occupation:
Age:
In-game name:

 
#5 Posted at 2017-12-01 15:37        
     
# XianGrim : Try it. If that doesn't work, it might be:

_items = items player;
if (!("ToolKit" in _items)) exitWith {};

Not home to test so try it and see.

Thx bae

Added 1 second later:

# XianGrim : Try it. If that doesn't work, it might be:

_items = items player;
if (!("ToolKit" in _items)) exitWith {};

Not home to test so try it and see.

Thx bae