Advertisement
Guest User

Untitled

a guest
Apr 9th, 2014
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. // Headless client check and playerClient array builder
  2. //Originally created by the MSO team under an Apache licence and released under same license http://dev.withsix.com/projects/mso
  3. //Modified by Zorrobyte to build playerClient array,pVar
  4. isHC = false;
  5.  
  6. if(isNil "headlessClients" && isServer) then {
  7. headlessClients = [];
  8. playerClients = [];
  9. publicVariable "headlessClients";
  10. publicVariable "playerClients";
  11. };
  12.  
  13. waitUntil{!isNil "headlessClients"};
  14. waitUntil{!isNil "playerClients"};
  15.  
  16. if (!isDedicated) then {
  17. //if player client then (not server)
  18. private["_hc","_lock"];
  19. _hc = ppEffectCreate ["filmGrain", 2005];
  20. //Create effect on all clients
  21. if (_hc == -1) then {
  22. isHC = true;
  23. //If any client not 3d renderer, then set isHC true
  24. // Random delay
  25. for [{_x=1},{_x<=random 10000},{_x=_x+1}] do {};
  26. if(!(player in headlessClients)) then {
  27. //if NOT (player in headlessClients) then do
  28. headlessClients set [count headlessClients, player];
  29. //set array headlessClients index headlessClients add player
  30. publicVariable "headlessClients";
  31. diag_log headlessClients;
  32. };
  33. } else {
  34. playerClients set [count playerClients, player];
  35. ppEffectDestroy _hc;
  36. publicVariable "playerClients";
  37. diag_log playerClients;
  38. };
  39. };
  40. isHC;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement