Advertisement
Guest User

Untitled

a guest
Aug 1st, 2014
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.26 KB | None | 0 0
  1.  
  2. // CONFIG.CPP
  3. class Bec
  4. {
  5.     /* General Information */
  6.     name = "Bec NamedPipe Client";
  7.     dir = "@Bec";
  8.     version = "0.1";
  9.     author[] = {"Stian Mikalsen"};
  10.     authorUrl = "http://www.ibattle.org";
  11.    
  12.     /* Requirements */
  13.     requiredAddons[] = {};
  14.     requiredVersion = 1;
  15.    
  16.     /* Includes */
  17.     units[] = {};
  18.     weapons[] = {};
  19.    
  20.     /* Display */
  21.     hideName = "false";
  22.     hidePicture = "true";
  23.     //picture = "";
  24.    
  25.     /* Extra */
  26.     actionName = "Website";
  27.     action = "http://www.ibattle.org"; // URL
  28.     description = "";
  29. };
  30.  
  31. class CfgPatches {
  32.     class Bec_main : Bec {};
  33. };
  34.  
  35. class CfgMods {
  36.     class Bec_mod : Bec {};
  37. };
  38.  
  39. class CfgFunctions
  40. {
  41.     class Bec
  42.     {
  43.         class main
  44.         {
  45.             //class startServer
  46.             //{
  47.             //  file = "\Bec\fn_init.sqf";
  48.             //  postInit  = 1;
  49.             //};
  50.            
  51.             class init
  52.             {
  53.                 file="\Bec\fn_init.sqf";
  54.                 //preInit=1;
  55.                 postInit=1;
  56.             };
  57.  
  58.             class onPlayerConnected
  59.             {
  60.                 file="\Bec\fn_onPlayerConnected.sqf";
  61.             };
  62.  
  63.             class onKilled
  64.             {
  65.                 file="\Bec\fn_onKilled.sqf";
  66.             };         
  67.            
  68.         };
  69.     };
  70. };
  71.  
  72.  
  73. //****************************************************
  74. // FN_INIT.SQF
  75. ["BEC_id", "onPlayerConnected", "[_id, _uid, _name] call BEC_fnc_onPlayerConnected"] call BIS_fnc_addStackedEventhandler;
  76.  
  77.  
  78. //****************************************************
  79. // FN_ONPLAYERCONNECTED.SQF
  80. _uid = _this select 1;
  81.  
  82. {
  83.     // add the evh to the player, playableUnits will not return a uid if its no player
  84.     if (isPlayer _x) then {
  85.         if ((getPlayerUID _x) == _uid) exitWith
  86.         {
  87.             _x setvariable ["Bec_pside", [side _x, name _x]];
  88.             _x addMPEventHandler ["MPKilled", {_this call BEC_fnc_onKilled}];
  89.         };
  90.     };
  91. } forEach playableUnits;
  92.  
  93.  
  94.  
  95.  
  96. //****************************************************
  97. // FN_ONKILLED.SQF
  98. _victim = _this select 0;
  99. _killer = _this select 1;
  100.  
  101. _side_victim = _victim getvariable "Bec_pside" select 0;
  102. _side_killer = _killer getvariable "Bec_pside" select 0;
  103.  
  104. _name_victim = _victim getvariable "Bec_pside" select 1;
  105. _name_killer = _killer getvariable "Bec_pside" select 1;
  106.  
  107. diag_log text format["EH MPKILLED : %1 : %2 -KILLED BY- %3 : %4",_side_victim, _name_victim, _side_killer, _name_killer];
  108.  
  109. if (_side_victim == _side_killer) then
  110. {
  111.     "BecNpc" callExtension format["%1 ::: %2", _name_victim, _name_killer];;
  112. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement