Jump to content

Recommended Posts

Hello everyone,

 

I have a question here. I started working on something that I considered really simple which turned out fast a bit more complicated. I've been continiously banging my head on my desk for the past hour so I decided to come over here where I would surely get help from some of the more talented folks out there. Basically how do I check if and what the player has selected in his inventory? For example:

 

70C0680B00D5AD68E499AE4652AC458F51DD3340

 

In this screenshot the player has selected the First Aid Kit. How do I check if he actually has done that?

Share this post


Link to post
Share on other sites

As GOM says explain what you want to do in more detail, if people know the reason and end result that your looking for then there maybe other ways to do it.

This thread HERE may help. Example could do with updating to use the new inventory eventHandler but it still works.

Share this post


Link to post
Share on other sites

Try with user interface EH, this is how I'd do it :

while {true} do {
	waituntil {!(isnull (finddisplay 602))};
	{
		((findDisplay 602) displayCtrl _x) ctrlSetEventHandler ["LBSelChanged", "hint str _this"];
	} count [633, 638, 619];//uniform, vest, backpack
};

 

... ninja'd :ph34r:

  • Like 1

Share this post


Link to post
Share on other sites

What I am simply trying to do is when you double click a certain item it opens up a dialog

Share this post


Link to post
Share on other sites

In that case try the same examples we provided with the "LBDblClick" EH instead.

Share this post


Link to post
Share on other sites

Hey thank you everyone for your help the problem has been solved thanks to you guys. Here is the script for someone that will need it.

while {true} do {
waituntil {!(isnull (finddisplay 602))};
{
((findDisplay 602) displayCtrl _x) ctrlSetEventHandler ["LBDblClick", "if (""First Aid Kit"" == lbText [ctrlIDC (_this select 0), _this select 1]) then {createDialog ""AM_Telport_Dialog""};"];
} count [633, 638, 619];
};
  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×