Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- params ["_id","_uid","_name","_jip","_owner"];
- private _player = objNull;
- private _goodtogo = false;
- while {!_goodtogo} do
- {
- private _allHCs = entities "HeadlessClient_F";
- private _allHPs = allPlayers - _allHCs;
- {
- private _temp_uid = getPlayerUID _x;
- if (_uid == _temp_uid) then
- {
- _player = _x;
- _goodtogo = true;
- };
- } forEach _allHPs;
- sleep 1;
- };
- //if player found then do stuff
- if !(isNull _player) then
- {
- //send code to run on player
- private _codeForClient = {
- // Reset and old EH IDs and scripthandles
- if (!isNil "utility_8_chatIntercept_handle")then{
- terminate utility_8_chatIntercept_handle
- };
- if (!isNil "utility_8_chatIntercept_EHID")then{
- (findDisplay 24) displayRemoveEventHandler ["KeyDown",utility_8_chatIntercept_EHID];
- utility_8_chatIntercept_EHID = nil;
- };
- utility_8_chatIntercept_handle = [] spawn {
- private["_equal","_chatArr"];
- while{(true) && !(isNull player)} do{
- utility_8_chatString = "";
- waitUntil{sleep 0.22;!isNull (finddisplay 24 displayctrl 101)};
- utility_8_chatIntercept_EHID = (findDisplay 24) displayAddEventHandler["KeyDown",{
- if ((_this select 1) != 28) exitWith{false};
- _equal = false;
- _chatArr = toArray utility_8_chatString;
- //_chatArr resize 1;
- if ((_chatArr select 0) isEqualTo ((toArray "!") select 0))then{
- _equal = true;
- closeDialog 0;
- (findDisplay 24) closeDisplay 1;
- [player, _chatArr] remoteExec ["utility_8_fnc_state_2_apply", 2];
- };
- _equal
- }];
- waitUntil{
- if (isNull (finddisplay 24 displayctrl 101))exitWith{
- if (!isNil "utility_8_chatIntercept_EHID")then{
- (findDisplay 24) displayRemoveEventHandler ["KeyDown",utility_8_chatIntercept_EHID];
- };
- utility_8_chatIntercept_EHID = nil;
- true
- };
- utility_8_chatString = (ctrlText (finddisplay 24 displayctrl 101));
- false
- };
- };
- };
- };
- [[],_codeForClient] remoteExec ["spawn", _player];
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement