Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // CONFIG.CPP
- class Bec
- {
- /* General Information */
- name = "Bec NamedPipe Client";
- dir = "@Bec";
- version = "0.1";
- author[] = {"Stian Mikalsen"};
- authorUrl = "http://www.ibattle.org";
- /* Requirements */
- requiredAddons[] = {};
- requiredVersion = 1;
- /* Includes */
- units[] = {};
- weapons[] = {};
- /* Display */
- hideName = "false";
- hidePicture = "true";
- //picture = "";
- /* Extra */
- actionName = "Website";
- action = "http://www.ibattle.org"; // URL
- description = "";
- };
- class CfgPatches {
- class Bec_main : Bec {};
- };
- class CfgMods {
- class Bec_mod : Bec {};
- };
- class CfgFunctions
- {
- class Bec
- {
- class main
- {
- //class startServer
- //{
- // file = "\Bec\fn_init.sqf";
- // postInit = 1;
- //};
- class init
- {
- file="\Bec\fn_init.sqf";
- //preInit=1;
- postInit=1;
- };
- class onPlayerConnected
- {
- file="\Bec\fn_onPlayerConnected.sqf";
- };
- class onKilled
- {
- file="\Bec\fn_onKilled.sqf";
- };
- };
- };
- };
- //****************************************************
- // FN_INIT.SQF
- ["BEC_id", "onPlayerConnected", "[_id, _uid, _name] call BEC_fnc_onPlayerConnected"] call BIS_fnc_addStackedEventhandler;
- //****************************************************
- // FN_ONPLAYERCONNECTED.SQF
- _uid = _this select 1;
- {
- // add the evh to the player, playableUnits will not return a uid if its no player
- if (isPlayer _x) then {
- if ((getPlayerUID _x) == _uid) exitWith
- {
- _x setvariable ["Bec_pside", [side _x, name _x]];
- _x addMPEventHandler ["MPKilled", {_this call BEC_fnc_onKilled}];
- };
- };
- } forEach playableUnits;
- //****************************************************
- // FN_ONKILLED.SQF
- _victim = _this select 0;
- _killer = _this select 1;
- _side_victim = _victim getvariable "Bec_pside" select 0;
- _side_killer = _killer getvariable "Bec_pside" select 0;
- _name_victim = _victim getvariable "Bec_pside" select 1;
- _name_killer = _killer getvariable "Bec_pside" select 1;
- diag_log text format["EH MPKILLED : %1 : %2 -KILLED BY- %3 : %4",_side_victim, _name_victim, _side_killer, _name_killer];
- if (_side_victim == _side_killer) then
- {
- "BecNpc" callExtension format["%1 ::: %2", _name_victim, _name_killer];;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement