Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. params ["_id","_uid","_name","_jip","_owner"];
  2. private _player = objNull;
  3. private _goodtogo = false;
  4. while {!_goodtogo} do
  5. {
  6. private _allHCs = entities "HeadlessClient_F";
  7. private _allHPs = allPlayers - _allHCs;
  8. {
  9. private _temp_uid = getPlayerUID _x;
  10. if (_uid == _temp_uid) then
  11. {
  12. _player = _x;
  13. _goodtogo = true;
  14. };
  15. } forEach _allHPs;
  16. sleep 1;
  17. };
  18.  
  19. //if player found then do stuff
  20. if !(isNull _player) then
  21. {
  22. //send code to run on player
  23. private _codeForClient = {
  24. // Reset and old EH IDs and scripthandles
  25. if (!isNil "utility_8_chatIntercept_handle")then{
  26. terminate utility_8_chatIntercept_handle
  27. };
  28. if (!isNil "utility_8_chatIntercept_EHID")then{
  29. (findDisplay 24) displayRemoveEventHandler ["KeyDown",utility_8_chatIntercept_EHID];
  30. utility_8_chatIntercept_EHID = nil;
  31. };
  32.  
  33. utility_8_chatIntercept_handle = [] spawn {
  34. private["_equal","_chatArr"];
  35.  
  36. while{(true) && !(isNull player)} do{
  37. utility_8_chatString = "";
  38.  
  39. waitUntil{sleep 0.22;!isNull (finddisplay 24 displayctrl 101)};
  40.  
  41. utility_8_chatIntercept_EHID = (findDisplay 24) displayAddEventHandler["KeyDown",{
  42. if ((_this select 1) != 28) exitWith{false};
  43.  
  44. _equal = false;
  45.  
  46. _chatArr = toArray utility_8_chatString;
  47. //_chatArr resize 1;
  48. if ((_chatArr select 0) isEqualTo ((toArray "!") select 0))then{
  49.  
  50. _equal = true;
  51. closeDialog 0;
  52. (findDisplay 24) closeDisplay 1;
  53.  
  54. [player, _chatArr] remoteExec ["utility_8_fnc_state_2_apply", 2];
  55. };
  56.  
  57. _equal
  58. }];
  59.  
  60. waitUntil{
  61. if (isNull (finddisplay 24 displayctrl 101))exitWith{
  62. if (!isNil "utility_8_chatIntercept_EHID")then{
  63. (findDisplay 24) displayRemoveEventHandler ["KeyDown",utility_8_chatIntercept_EHID];
  64. };
  65. utility_8_chatIntercept_EHID = nil;
  66. true
  67. };
  68. utility_8_chatString = (ctrlText (finddisplay 24 displayctrl 101));
  69. false
  70. };
  71. };
  72. };
  73. };
  74. [[],_codeForClient] remoteExec ["spawn", _player];
  75. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement