Advertisement
Guest User

remote_messages.sqf

a guest
Apr 25th, 2014
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. /*
  2. Remote messages by maca134 [maca134@googlemail.com]
  3.  
  4. This allows you to send globalchat/hint/titlecut from the server to all or a specific player without having to use remote exec
  5.  
  6. (if you have resec.sqf then you can only do titletext via RE)
  7.  
  8. I wants to dp sidechat/groupchat too but it didnt work.
  9.  
  10. To install add '_nil = [] execVM "custom\remote_messages.sqf";' to your init.sqf inside the 'if (!isDedicated) then {' block.
  11.  
  12. Global chat can only be sent to a single user and requires 'enableRadio true;' in init.sqf
  13.  
  14. Here are some examples:
  15.  
  16. customRemoteMessage = ['globalChat', "say something in globalChat", _unit];
  17. publicVariable "customRemoteMessage";
  18.  
  19. customRemoteMessage = ['titleCut', "say something in titleCut", _unit];
  20. publicVariable "customRemoteMessage";
  21.  
  22. customRemoteMessage = ['hint', "say something in hint", _unit];
  23. publicVariable "customRemoteMessage";
  24.  
  25. customRemoteMessage = ['titleCut', "say something in titleCut"];
  26. publicVariable "customRemoteMessage";
  27.  
  28. customRemoteMessage = ['hint', "say something in hint"];
  29. publicVariable "customRemoteMessage";
  30.  
  31. customRemoteMessage = ["titleText", "say something in hint"];
  32. publicVariable "customRemoteMessage";
  33.  
  34. customRemoteMessage = ["titleText", "say something in hint", _unit];
  35. publicVariable "customRemoteMessage";
  36. */
  37.  
  38. fnc_remote_message = {
  39. private ["_type", "_message", "_player"];
  40. _type = _this select 0;
  41. _message = _this select 1;
  42. if (count _this > 2) then {
  43. _player = _this select 2;
  44. if (_player == player) then {
  45. switch (_type) do {
  46. case "globalChat": {
  47. player globalChat _message;
  48. };
  49. case "hint": {
  50. hint _message;
  51. };
  52. case "titleCut": {
  53. titleCut [_message, "PLAIN DOWN", 3];
  54. };
  55. case "titleText": {
  56. titleText [_message, "PLAIN DOWN"]; titleFadeOut 10;
  57. };
  58. };
  59. };
  60. } else {
  61. switch (_type) do {
  62. case "hint": {
  63. hint _message;
  64. };
  65. case "titleCut": {
  66. titleCut [_message,"Plain Down",3];
  67. };
  68. case "titleText": {
  69. titleText [_message, "PLAIN DOWN"]; titleFadeOut 10;
  70. };
  71. };
  72. };
  73. };
  74.  
  75. "customRemoteMessage" addPublicVariableEventHandler {(_this select 1) call fnc_remote_message;};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement