What's new
Roleplay UK

Join the UK's biggest roleplay community on FiveM and experience endless new roleplay opportunities!

addEventHandler issue

DTYlan

Well-known member
Unlinked
Location
Slough
I'm currently building a sandbox and I hit a wall in what I'm doing.

My issue is that I'm not sure if my event handler is being added to the player?

Event Handler:

Code:
player addEventHandler ["onMouseButtonClick", {_this exec "selectedType.sqf"}];
selectedType.sqf:

Code:
{
  _selected = _combobox lbIsSelected _forEachIndex;
  if (_selected == true) then {
    _selectedType = _forEachIndex;
    hint format["%1", _forEachIndex];
  }
  else
  {
    hint "None Selected";
  };
} forEach _type;
(We should try and get a SQF syntax format for the code quote)

As you may see above that the event handler calls the sqf file that just wants to check to see if any of the ComboBox (_type) array has been selected and if one comes up as true it will hint the index number else it will say none has been selected.

The event handler is a child to a dialog but should that effect it?

The way I know that this isn't being executed is because I'm getting no output, not even an error.

Any help would be greatly appreciated, thanks.

 
Back
Top