silly git reverted

This commit is contained in:
happydayz 2016-01-14 15:01:21 +11:00
parent 04f87ba345
commit 8d4d48e992
17 changed files with 542 additions and 419 deletions

Binary file not shown.

View File

@ -1 +0,0 @@
enigma_exile_custom

View File

@ -1,331 +0,0 @@
/*
[_ZEN_] Happydayz
------ ENIGMA ------
*/
private["_handguntype","_handgunammo","_player","_playerID","_playerPos","_reviveused","_reviverownerID","_bambiPlayerID","_playerPos","_data","_extDB2Message","_revivername","_msg","_reviveused","_ind","_playerID","_sessionID","_requestingPlayer", "_requestingPlayerUID", "_items", "_dir", "_location", "_type", "_weapon", "_attachments", "_currWeap", "_itemSlot", "_itemqtys", "_goggles", "_headgear", "_vest", "_backpack", "_uniform", "_weapons", "_magazinesAmmo", "_itemsplayer", "_weaponsplayer", "_group", "_primaryWeapon", "_secondaryWeapon", "_attachment", "_equipped", "_wMags", "_requestingPlayerGroup", "_droppedWeapons", "_bambiPlayer", "_ownerID", "_reviver"];
_requestingPlayer = _this select 0;
_ownerID = owner _requestingPlayer;
_reviver = _this select 1;
_reviverownerID = owner _reviver;
_sessionID = _requestingPlayer getVariable ["ExileSessionID",""];
_reviversessionID = _reviver getVariable ["ExileSessionID",""];
_name = name _requestingPlayer;
_revivername = name _reviver;
_clanID = (_accountData select 4);
_clanName = (_accountData select 5);
_playerID = _requestingPlayer getVariable["ExileDatabaseID", -1];
if (isNull _requestingPlayer) exitWith{ diag_log "EnigmaRevive - No requesting player"};
if (_requestingPlayer distance _reviver > 5) exitWith{ diag_log "EnigmaRevive - Too far from target"};
if (!local _requestingPlayer) then {
_requestingPlayerUID = getPlayerUID _requestingPlayer;
if (!isNil "_requestingPlayerUID" && !alive _requestingPlayer) then {
_accountData = format["getAccountStats:%1", _requestingPlayerUID] call ExileServer_system_database_query_selectSingle;
if (_requestingPlayer == _reviver) exitWith {
Diag_log format ["Enigma Revive - Attempted hack revive by %1",_requestingPlayer];
};
_ind = ((count ReviveChk_cache) - 1);
{
if (_playerID in _x) then {
_reviveused = _x select 1;
_ind = _forEachIndex;
};
} forEach ReviveChk_cache;
if (isNil "_reviveused") then {_reviveused = 0;}; //if not found in array then they havent used a revive this life so set to 0!
// if ((_requestingPlayer getVariable["REVIVE", false])||(_reviveused > MaxRevivesAllowed)) exitWith{ //somewhere on first revive im setting variable to false... WHERE!?!?!?!?!
if (_reviveused == MaxRevivesAllowed) exitWith{
EnigmaReviveFail = [_requestingPlayer, _revivername];
_ownerID publicVariableClient "EnigmaReviveFail";
_msgarray = [];
_msgarray = [
"You put the probes in the wrong place!",
"You didnt let the defib charge for long enough!",
"You forgot to lubricate the probes! You smell sizzling flesh! Oops!"
];
_randommsg = _msgarray call BIS_fnc_selectRandom;
_msg = format ["%1 You killed %2!",_randommsg,_name];
EnigmaReviveMSG = [_msg]; //make the _reviver kill the player! hehehehe
_reviverownerID publicVariableClient "EnigmaReviveMSG";
};
if (_requestingPlayer getVariable["REVIVE", true]) then {
_location = getPosATL _requestingPlayer;
_dir = getDir _requestingPlayer;
_requestingPlayerGroup = _requestingPlayer getVariable["GROUP", ""];
_goggles = goggles _requestingPlayer;
_headgear = headgear _requestingPlayer;
_vest = vest _requestingPlayer;
_backpack = backpack _requestingPlayer;
_uniform = uniform _requestingPlayer;
_items = assignedItems _requestingPlayer;
_magazinesAmmo = magazinesAmmo _requestingPlayer;
_handgunammo = _requestingPlayer ammo handgunWeapon _requestingPlayer; //counts rounds in magazine inside handgun
_handguntype = handgunWeapon _requestingPlayer;
/*
Todo: Need to delete any items dropped on ground around me as they are duping for a few seconds after revive!!!
*/
_primaryWeapon = "";
_secondaryWeapon = "";
_itemsplayer = [getItemCargo(uniformContainer _requestingPlayer), getItemCargo(vestContainer _requestingPlayer), getItemCargo(backpackContainer _requestingPlayer)];
_weaponsplayer = [getWeaponCargo(uniformContainer _requestingPlayer), getWeaponCargo(vestContainer _requestingPlayer), getWeaponCargo(backpackContainer _requestingPlayer)];
//_weapons = [currentWeapon _requestingPlayer, ((weaponsItems _requestingPlayer) + _droppedWeapons), [_primaryWeapon, _secondaryWeapon, handgunWeapon _requestingPlayer]];
_weapons = [currentWeapon _requestingPlayer, (weaponsItems _requestingPlayer), [_primaryWeapon, _secondaryWeapon, handgunWeapon _requestingPlayer]];
hideObjectGlobal _requestingPlayer;
_group = grpNull;
_group = createGroup independent;
_bambiPlayer = _group createUnit["Exile_Unit_Player", _location, [], 0, "CAN_COLLIDE"];
_bambiPlayer allowDammage false;
_bambiPlayer disableAI "FSM";
_bambiPlayer disableAI "MOVE";
_bambiPlayer disableAI "AUTOTARGET";
_bambiPlayer disableAI "TARGET";
_bambiPlayer disableAI "CHECKVISIBLE";
if !((typeName _clanID) isEqualTo "SCALAR") then
{_clanID = -1;
_clanName = "";};
_bambiPlayer setFatigue FatiguewhenRevived;
_bambiPlayer setDamage DamageWhenRevived;
_bambiPlayer setDir _dir;
_bambiPlayer setPosATL _location;
if (_uniform != "") then {_bambiPlayer addUniform _uniform;};
if (_backpack != "") then {_bambiPlayer addBackpack _backpack;};
if (_goggles != "") then {_bambiPlayer addGoggles _goggles;};
if (_headgear != "") then {_bambiPlayer addHeadgear _headgear;};
if (_vest != "") then {_bambiPlayer addVest _vest;};
if (count _weapons >= 2) then {
_equipped = _weapons select 2;
{
_weapon = _x select 0;
_type = getNumber(configfile >> "cfgweapons" >> _weapon >> "type");
_attachments = [];
for "_a" from 1 to 3 do {
_attachment = _x select _a;
if (_attachment != "") then {
_attachments pushBack _attachment;
};
};
_wMags = (count _x) == 5;
if (_weapon in _equipped) then {
_equipped = _equipped - [_weapon];
if (_wMags) then { _bambiPlayer addMagazine(_x select 4);};
if (_weapon != "") then { _bambiPlayer addWeapon _weapon;};
switch _type do {
case 1: { removeAllPrimaryWeaponItems _bambiPlayer; { _bambiPlayer addPrimaryWeaponItem _x }forEach _attachments;};
case 2: { removeAllHandgunItems _bambiPlayer; { _bambiPlayer addHandgunItem _x }forEach _attachments;};
case 4: { { _bambiPlayer addSecondaryWeaponItem _x }forEach _attachments;};};
} else {{_bambiPlayer addItem _x;}forEach _attachments;
if (_wMags) then {_bambiPlayer addMagazine(_x select 4);};};} forEach (_weapons select 1);
_currWeap = (_weapons select 0);
};
{if (_x in ["Binocular","Rangefinder","Laserdesignator","Laserdesignator_02","Laserdesignator_03"]) then {_bambiPlayer addWeapon _x;} else {_bambiPlayer linkItem _x;};}forEach _items;
{_itemSlot = _forEachIndex;
_itemqtys = _x select 1;
{for "_i" from 1 to (_itemqtys select _forEachIndex) do {
switch _itemSlot do {
case 0: { _bambiPlayer addItemToUniform _x };
case 1: { _bambiPlayer addItemToVest _x };
case 2: { _bambiPlayer addItemToBackpack _x };
};
};
}forEach (_x select 0);
}forEach _itemsplayer;
{_itemSlot = _forEachIndex;
_itemqtys = _x select 1;
{for "_i" from 1 to (_itemqtys select _forEachIndex) do {
switch _itemSlot do {
case 0: { _bambiPlayer addItemToUniform _x };
case 1: { _bambiPlayer addItemToVest _x };
case 2: { _bambiPlayer addItemToBackpack _x };
};
};
}forEach (_x select 0);
}forEach _weaponsplayer;
{_bambiPlayer addMagazine _x;}forEach _magazinesAmmo;
_bambiPlayer addMagazine [_handguntype, _handgunammo]; //fix handgun losing its ammo! puts mag back into inventory ---Not working... something removes the mag after 10 seconds or so... guessing exile load up!
_bambiPlayer setName _name;
_bambiPlayer setVariable ["ExileMoney", (_accountData select 0)];
_bambiPlayer setVariable ["ExileScore", (_accountData select 1)];
_bambiPlayer setVariable ["ExileKills", (_accountData select 2)];
_bambiPlayer setVariable ["ExileDeaths", (_accountData select 3)];
_bambiPlayer setVariable ["ExileClanID", _clanID];
_bambiPlayer setVariable ["ExileClanName", _clanName];
_bambiPlayer setVariable ["ExileHunger", 50];//set to 50% as shouldnt be expect to be full fit and healthy after a defib!
_bambiPlayer setVariable ["ExileThirst", 50];//set to 50% as shouldnt be expect to be full fit and healthy after a defib!
_bambiPlayer setVariable ["ExileAlcohol", 0.1]; //testing making player a little "drunk" after the defib ;)
_bambiPlayer setVariable ["ExileName", _name];
_bambiPlayer setVariable ["ExileOwnerUID", getPlayerUID _requestingPlayer];
_bambiPlayer setVariable ["ExileIsBambi", false];
_bambiPlayer setVariable ["ExileXM8IsOnline", false, true];
diag_log format ["Bambiplayer = %1 --- _sessionID = %2",_bambiPlayer,_sessionID];
private["_player","_playerID","_playerPos","_data","_extDB2Message"];
_player = _bambiPlayer;
_playerID = format["createPlayer:%1:%2", _player getVariable ["ExileOwnerUID", "SomethingWentWrong"], _player getVariable ["ExileName", "SomethingWentWrong"]] call ExileServer_system_database_query_insertSingle;
_player setVariable ["ExileDatabaseID", _playerID];
_playerPos = getPosATL _player;
_data =
[
_player getVariable ["ExileName",""],
damage _player,
_player getVariable ["ExileHunger", 100],
_player getVariable ["ExileThirst", 100],
_player getVariable ["ExileAlcohol", 0],
getOxygenRemaining _player,
getBleedingRemaining _player,
_player call ExileClient_util_player_getHitPointMap,
getDir _player,
_playerPos select 0,
_playerPos select 1,
_playerPos select 2,
assignedItems _player,
backpack _player,
(getItemCargo backpackContainer _player) call ExileClient_util_cargo_getMap,
(backpackContainer _player) call ExileClient_util_cargo_getMagazineMap,
(getWeaponCargo backpackContainer _player) call ExileClient_util_cargo_getMap,
currentWeapon _player,
goggles _player,
handgunItems _player,
handgunWeapon _player,
headgear _player,
binocular _player,
_player call ExileClient_util_inventory_getLoadedMagazinesMap,
primaryWeapon _player,
primaryWeaponItems _player,
secondaryWeapon _player,
secondaryWeaponItems _player,
uniform _player,
(getItemCargo uniformContainer _player) call ExileClient_util_cargo_getMap,
(uniformContainer _player) call ExileClient_util_cargo_getMagazineMap,
(getWeaponCargo uniformContainer _player) call ExileClient_util_cargo_getMap,
vest _player,
(getItemCargo vestContainer _player) call ExileClient_util_cargo_getMap,
(vestContainer _player) call ExileClient_util_cargo_getMagazineMap,
(getWeaponCargo vestContainer _player) call ExileClient_util_cargo_getMap,
_playerID
];
_extDB2Message = ["updatePlayer", _data] call ExileServer_util_extDB2_createMessage;
_extDB2Message call ExileServer_system_database_query_fireAndForget;
_player setVariable ["REVIVE", true, true];
_bambiPlayer setVariable ["REVIVE", true, true];
_ind = ((count ReviveChk_cache) - 1);
{
if (_bambiPlayerID in _x) then {
_reviveused = _x select 1;
_ind = _forEachIndex;
};
} forEach ReviveChk_cache;
_reviveused = _reviveused + 1;
ReviveChk_cache set [_ind, [_playerID, _reviveused]]; //add this revive to total number of player revives!
//just in case the array check fails (they are fickle beasts sometimes when servers are under load!)
if (_reviveused > MaxRevivesAllowed) then {
_bambiPlayer setVariable ["REVIVE", false, true];
};
_msg = format ["%1 has been stabilised! You have been rewarded 100 Respect!",_name];
EnigmaReviveMSG = [_msg]; //sends message to reviver!
_reviverownerID publicVariableClient "EnigmaReviveMSG";
_newScore = _requestingPlayer getVariable ["ExileScore", 0];
_newScore = _newScore + 100;
_requestingPlayer setVariable ["ExileScore", _newScore];
format["setAccountScore:%1:%2", _newScore, getPlayerUID _requestingPlayer] call ExileServer_system_database_query_fireAndForget;
_player addMPEventHandler ["MPKilled", {_this call ExileServer_object_player_event_onMpKilled}];
[
_sessionID,
"loadPlayerResponse",
[
(netId _player),
str (_player getVariable ["ExileMoney", 0]),
str (_player getVariable ["ExileScore", 0]),
(_player getVariable ["ExileKills", 0]),
(_player getVariable ["ExileDeaths", 0]),
(_player getVariable ["ExileHunger", 100]),
(_player getVariable ["ExileThirst", 100]),
(_player getVariable ["ExileAlcohol", 0]),
(_player getVariable ["ExileClanName", ""])
]
]
call ExileServer_system_network_send_to;
[_sessionID, _player] call ExileServer_system_session_update;
_requestingPlayer setposatl [0,0,0];
deleteVehicle _requestingPlayer;
EnigmaRevive = [];
_ownerID publicVariableClient "EnigmaRevive";
};
};
};

View File

@ -1,35 +0,0 @@
/*
[_ZEN_] Happydayz
------ ENIGMA ------
*/
Private["_target","_newmoneyvalue","_newscorevalue","_newMoney","_newScore"];
_target = _this select 0;
_newmoneyvalue = _this select 1;
_newscorevalue = _this select 2;
diag_log ["%1 Executing Exile_UpdateStats, Adding %2 Poptabs and %3 Respect",_target,_newmoneyvalue,_newscorevalue];
if (_newmoneyvalue > 0) then {
_target setVariable ['ExileMoney', _newmoneyvalue];
_target setVariable['PLAYER_STATS_VAR',[_newmoneyvalue,_target getVariable ['ExileScore', 0]],true];
ExileClientPlayerMoney = _newmoneyvalue;
(owner _target) publicVariableClient 'ExileClientPlayerMoney';
format['setAccountMoney:%1:%2', _newmoneyvalue, (getPlayerUID _target)] call ExileServer_system_database_query_fireAndForget;
};
if (_newscorevalue > 0) then
{
_target setVariable ['ExileScore', _newscorevalue];
_target setVariable['PLAYER_STATS_VAR',[_target getVariable ['ExileMoney', 0],_newscorevalue],true];
ExileClientPlayerScore = _newscorevalue;
(owner _target) publicVariableClient 'ExileClientPlayerScore';
format['setAccountScore:%1:%2', _newscorevalue, (getPlayerUID _target)] call ExileServer_system_database_query_fireAndForget;
};

View File

@ -1,29 +0,0 @@
class CfgPatches
{
class enigma_exile_custom {
units[] = {};
weapons[] = {};
requiredVersion = 0.1;
author[]= {"Happydayz_EngimaTeam"};
};
};
class CfgFunctions
{
class EnigmaTeam
{
class main
{
file = "\enigma_exile_custom\init";
class init
{
preInit = 1;
};
class postinit
{
postInit = 1;
};
};
};
};

View File

@ -1,5 +0,0 @@
diag_log format['Enigma Exile: fn_init %1',time];
call compile preprocessFileLineNumbers "\enigma_exile_custom\init\server_compiles.sqf";
true

View File

@ -1,5 +0,0 @@
diag_log format['Enigma Exile: postinit %1',time];
[]spawn{call compile preprocessFileLineNumbers "\enigma_exile_custom\init\server_init.sqf";
};
true

View File

@ -1,5 +0,0 @@
diag_log format['Enigma Exile: Compiles Started - %1',time];
ENIGMA_server_publicEH =compileFinal preprocessFileLineNumbers "\enigma_exile_custom\init\server_publicEH.sqf";
ENIGMA_server_handle_UpdateStats =compileFinal preprocessFileLineNumbers "\enigma_exile_custom\compile\Enigma\Exile_UpdateStats.sqf";
ENIGMA_server_revivePlayer =compileFinal preprocessFileLineNumbers "\enigma_exile_custom\compile\Enigma\Exile_RevivePlayer.sqf";

View File

@ -1,4 +0,0 @@
diag_log format['Enigma Exile: server_init %1',time];
call ENIGMA_server_publicEH;
diag_log "ENIGMA: Init PublicEH";

View File

@ -1,4 +0,0 @@
diag_log format['Enigma Exile: publicEH %1',time];
"ENIGMA_UpdateStats" addPublicVariableEventHandler{(_this select 1)call ENIGMA_server_handle_UpdateStats};
"ENIGMA_revivePlayer" addPublicVariableEventHandler{(_this select 1)call ENIGMA_server_revivePlayer};

View File

@ -0,0 +1,33 @@
/*
Enigma_RevivePlyr.sqf
[_ZEN_] Enigma (Happydayz)
*/
private["_target","_targetname","_updatestats"];
_target = _this select 0;
_targetname = name _target;
if !(isPlayer _target) exitWith {systemChat Format ["Theres no pulse..."]};
if (_target getVariable "EnigmaRevivePermitted") then {
if (magazines player find "Exile_Item_Defibrillator" >= 0) then {
_target switchMove "AinjPpneMstpSnonWrflDnon";
sleep 0.2;
player playMove "AinvPknlMstpSlayWrflDnon_medic";
sleep 6;
player switchmove ""; //incase get stuck in animation
if (_target getVariable["REVIVE", true]) then {
_target setVariable["antidupe", -1, true]; //targetted player inventory is now locked out from accessing!
ENIGMA_revivePlayer = [_target,player,1];
publicVariableServer "ENIGMA_revivePlayer";
} else {
systemChat Format ["RIP %1! They suffered a fatal injury!",_targetname];
};
};
} else {
systemChat Format ["RIP %1! They suffered a fatal injury!",_targetname];
};

View File

@ -0,0 +1,123 @@
/**
* ExileClient_object_player_death_startBleedingOut
*
* Exile Mod
* www.exilemod.com
* <20> 2015 Exile Mod Team
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
*/
private["_respawnDelay","_layer","_descriptions"];
_respawnDelay = _this;
oldgroup = group player;
/////////////////////////////////added by happydayz/////////////////////////////////////
if (player getVariable["REVIVE", true]) then {
_descriptions =
[
"KNOCKED OUT",
"CRITICALLY WOUNDED",
"BLEEDING OUT",
"ON DEATHS DOOR"
];
player setVariable ['EnigmaRevivePermitted', true, true]; //adds action to be revived
////////////////////////////////////////////////////////////////////////////////////////
[100] call BIS_fnc_bloodEffect;
ExileClientPostProcessingColorCorrections ppEffectAdjust [1, 1.1, -0.05, [0.4, 0.2, 0.3, -0.1], [0.79, 0.72, 0.62, 0], [0.5,0.5,0.5,0], [0,0,0,0,0,0,4]];
ExileClientPostProcessingColorCorrections ppEffectCommit 0;
ExileClientPostProcessingColorCorrections ppEffectAdjust [1, 1.1, -0.05, [0.4, 0.2, 0.3, -0.1], [0.3, 0.05, 0, 0], [0.5,0.5,0.5,0], [0,0,0,0,0,0,4]];
ExileClientPostProcessingColorCorrections ppEffectCommit _respawnDelay;
ExileClientPostProcessingBackgroundBlur ppEffectAdjust [0];
ExileClientPostProcessingBackgroundBlur ppEffectCommit 0;
ExileClientPostProcessingBackgroundBlur ppEffectEnable true;
ExileClientPostProcessingBackgroundBlur ppEffectAdjust [2];
ExileClientPostProcessingBackgroundBlur ppEffectCommit _respawnDelay;
ExileClientBleedOutHeartbeatPlaying = false;
ExileClientBleedOutCountDownDuration = _respawnDelay;
ExileClientBleedOutCountDownEnd = time + _respawnDelay;
_layer = "BIS_fnc_respawnCounter" call bis_fnc_rscLayer;
_layer cutText ["", "plain"];
missionnamespace setvariable ["RscRespawnCounter_description", format ["<t size='2' align='center'>%1</t>", _descriptions call BIS_fnc_selectRandom]];
missionnamespace setvariable ["RscRespawnCounter_colorID", 0];
missionnamespace setvariable ["RscRespawnCounter_Custom", _respawnDelay];
_layer cutRsc ["RscRespawnCounter", "plain"];
showChat true;
"Start bleeding out..." call ExileClient_util_log;
if(ExileClientBleedOutThread isEqualTo -1)then
{
ExileClientBleedOutThread = [2, ExileClient_object_player_thread_bleedToDeath, [], true] call ExileClient_system_thread_addtask;
};
} else {
_descriptions =
[
"WRECKED",
"REKT",
"STOMPED",
"WASTED",
"SCREWED",
"TOASTED",
"REST IN PIECES",
"TERMINATED",
"KILLED",
"EXILED",
"ANNIHILATED",
"HAMMERED",
"NEUTRALIZED",
"DUMPED",
"ZAPPED",
"SLAIN",
"FRIED",
"WIPED OUT",
"VANQUISHED",
"BUSTED",
"PULVERIZED",
"SMASHED",
"SHREDDED",
"CRUSHED"
];
[100] call BIS_fnc_bloodEffect;
ExileClientPostProcessingColorCorrections ppEffectAdjust [1, 1.1, -0.05, [0.4, 0.2, 0.3, -0.1], [0.79, 0.72, 0.62, 0], [0.5,0.5,0.5,0], [0,0,0,0,0,0,4]];
ExileClientPostProcessingColorCorrections ppEffectCommit 0;
ExileClientPostProcessingColorCorrections ppEffectAdjust [1, 1.1, -0.05, [0.4, 0.2, 0.3, -0.1], [0.3, 0.05, 0, 0], [0.5,0.5,0.5,0], [0,0,0,0,0,0,4]];
ExileClientPostProcessingColorCorrections ppEffectCommit _respawnDelay;
ExileClientPostProcessingBackgroundBlur ppEffectAdjust [0];
ExileClientPostProcessingBackgroundBlur ppEffectCommit 0;
ExileClientPostProcessingBackgroundBlur ppEffectEnable true;
ExileClientPostProcessingBackgroundBlur ppEffectAdjust [2];
ExileClientPostProcessingBackgroundBlur ppEffectCommit _respawnDelay;
ExileClientBleedOutHeartbeatPlaying = false;
ExileClientBleedOutCountDownDuration = _respawnDelay;
ExileClientBleedOutCountDownEnd = time + _respawnDelay;
_layer = "BIS_fnc_respawnCounter" call bis_fnc_rscLayer;
_layer cutText ["", "plain"];
missionnamespace setvariable ["RscRespawnCounter_description", format ["<t size='2' align='center'>%1</t>", _descriptions call BIS_fnc_selectRandom]];
missionnamespace setvariable ["RscRespawnCounter_colorID", 0];
missionnamespace setvariable ["RscRespawnCounter_Custom", _respawnDelay];
_layer cutRsc ["RscRespawnCounter", "plain"];
showChat true;
"Start bleeding out..." call ExileClient_util_log;
if(ExileClientBleedOutThread isEqualTo -1)then
{
ExileClientBleedOutThread = [2, ExileClient_object_player_thread_bleedToDeath, [], true] call ExileClient_system_thread_addtask;
};
};
true

View File

@ -0,0 +1,47 @@
/**
* ExileClient_object_player_event_onInventoryOpened
*
* Exile Mod
* www.exilemod.com
* © 2015 Exile Mod Team
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
*/
private["_cancelEvent","_container"];
_cancelEvent = false;
_container = _this select 1;
if (ExileClientIsHandcuffed) then
{
_cancelEvent = true;
}
else
{
if (ExileClientIsInConstructionMode) then
{
_cancelEvent = true;
}
else
{
if ((locked _container) isEqualTo 2) then
{
_cancelEvent = true;
}
else
{
if ((_container getVariable ["ExileIsLocked", 1] isEqualTo -1) || (_container getVariable["antidupe", 1]) isEqualTo -1) then //added revive dupe test -- happdayz
{
hint "antidupe initiated";
_cancelEvent = true;
}
else
{
ExileClientInventoryOpened = true;
ExileClientCurrentInventoryContainer = _container;
};
};
};
};
_cancelEvent // OKAY!

View File

@ -0,0 +1,26 @@
/*
Enigma Exile Revive Compiles
[_ZEN_] Enigma (Happydayz)
*/
if (!hasInterface && isServer) exitWith {
Diag_log "Initializing Enigma Revive Compiles!";
};
private ['_code', '_function', '_file'];
{
_code = '';
_function = _x select 0;
_file = _x select 1;
_code = compileFinal (preprocessFileLineNumbers _file);
missionNamespace setVariable [_function, _code];
}
forEach
[
['Enigma_RevivePlyr', 'Custom\EnigmaRevive\Enigma_RevivePlyr.sqf']
];
true

View File

@ -0,0 +1,103 @@
/*
Enigma Exile Revive Initialization
[_ZEN_] Enigma (Happydayz)
*/
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////Custom Settings//////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if (!hasInterface && isServer) exitWith {
MaxRevivesAllowed = 1; //Set the max number of revives permitted per life. I recomend you keep it at 1. Just saying...
DamageWhenRevived = 0.95; //Set to a percentage. 0.95 = 95% damage.... or 5% health
FatiguewhenRevived = 1; //Set to a percentage. 1 = 100% fatigued and can only walk.
//NOTE: this has been designed to only allow 1 revive. I havent put in any checks to prevent players using this to gain respect by killing each other and reviving again!!!
//You have been warned!
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////DO NOT MODIFY BELOW THIS LINE///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////Server Settings/////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ReviveChk_cache = [];
ReviveChk_cache = [[0000,0]];
Diag_log "Initializing Enigma Revive!";
};
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////Client Settings//////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if (hasInterface) then {
[] execVM "Custom\EnigmaRevive\compiles.sqf";
player setVariable ['EnigmaRevivePermitted', false, true];
player setVariable["antidupe", 1, true];
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////EventHandlers//////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
"EnigmaRevive" addPublicVariableEventHandler {
private["_newPlayerObject","_oldPlayerObject","_packet","_weapon","_reviver"];
_packet = _this select 1;
_newPlayerObject = _packet select 0;
cutText ["","BLACK IN",20];
[100] call BIS_fnc_bloodEffect;
"Reviving player..." call ExileClient_util_log;
_layer = "BIS_fnc_respawnCounter" call bis_fnc_rscLayer;
_layer cutText ["", "plain"];
"Removing bleed out thread..." call ExileClient_util_log;
[ExileClientBleedOutThread] call ExileClient_system_thread_removeTask;
ExileClientBleedOutThread = -1;
player setVariable ['EnigmaRevivePermitted', false, true];
false call ExileClient_gui_postProcessing_toggleDialogBackgroundBlur;
true call ExileClient_gui_hud_toggle;
player setVariable["antidupe", 1, true]; //remove the antidupe from the revived player!
};
"EnigmaReviveFail" addPublicVariableEventHandler {
_packet = _this select 1;
_requestingPlayer = _packet select 0;
_revivername = _packet select 1;
systemChat Format ["%1 bungled your revive and killed you!",_revivername];
[] call ExileClient_gui_escape_respawn; //force kill player
};
"EnigmaReviveMSG" addPublicVariableEventHandler {
_packet = _this select 1;
_msg = _packet select 0;
systemChat Format ["%1",_msg];
};
waitUntil { uiSleep 0.5; !isNull(findDisplay 46); };
sleep 10;
systemChat "Loading: Enigma Exile Revive"; //Please leave this line as a way of saying thanks to me! :D HAPPYD
};

2
Exile.Altis/init.sqf Normal file
View File

@ -0,0 +1,2 @@
[] execVM "Custom\EnigmaRevive\init.sqf";

208
Readme.txt Normal file
View File

@ -0,0 +1,208 @@
changelog
13/01/16 -- prevent duping of gear by revived player.
14/01/16 -- prevent accessing gear on player being revived (stops duping).
------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------HOW TO UPGRADE TO ENIGMA EXILE REVIVE V0.65--------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------
- Replace server pbo. Replace Enigma Revive folder in mission file. New Line for cfgcustomcode:
//////////////////////////////////////////////////////////////////////////////////////////////////////
class CfgExileCustomCode {
ExileClient_object_player_death_startBleedingOut = "custom\EnigmaRevive\ExileClient_object_player_death_startBleedingOut.sqf"; //Happys Revive
ExileClient_object_player_event_onInventoryOpened = "custom\EnigmaRevive\ExileClient_object_player_event_onInventoryOpened.sqf"; //Happys Revive AntiDupe ---NEW with v0.65
};
//////////////////////////////////////////////////////////////////////////////////////////////////////
------------------------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------HOW TO INSTALL ENIGMA EXILE REVIVE V0.65---------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------
First add the startup paramaters @Enigma_Exile to your server!
Copy the @Enigma_Exile Folder to your Server Root!
Open up your mission file and add the init.sqf line to your init.sqf file (Must be executed by both server and client!)!
Copy the Entire Custom folder into the root of your mission file!
Now open your mission file --- config.cpp
Locate the lines:
//////////////////////////////////////////////////////////////////////////////////////////////////////
class Identify: ExileAbstractAction
{
title = "Identify Body";
condition = "!(alive ExileClientInteractionObject)";
action = "_this call ExileClient_object_player_identifyBody";
};
//////////////////////////////////////////////////////////////////////////////////////////////////////
Replace that whole section with this:
//////////////////////////////////////////////////////////////////////////////////////////////////////
class Identify: ExileAbstractAction
{
title = "Identify Body";
condition = "!(alive ExileClientInteractionObject)";
action = "_this call ExileClient_object_player_identifyBody";
};
//////////////Added by [_ZEN_]happydayz/////////////////
class Revive: ExileAbstractAction
{
title = "Perform CPR";
condition = "(!(alive ExileClientInteractionObject) && (ExileClientInteractionObject getVariable ['EnigmaRevivePermitted', true]) && (magazines player find 'Exile_Item_Defibrillator' >= 0))";
action = "_this spawn Enigma_RevivePlyr";
};
//////////////////////////////////////////////////////////////////////////////////////////////////////
Next go to:
//////////////////////////////////////////////////////////////////////////////////////////////////////
class CfgExileCustomCode {};
//////////////////////////////////////////////////////////////////////////////////////////////////////
and modify it to read:
//////////////////////////////////////////////////////////////////////////////////////////////////////
class CfgExileCustomCode {
ExileClient_object_player_death_startBleedingOut = "custom\EnigmaRevive\ExileClient_object_player_death_startBleedingOut.sqf"; //Happys Revive
ExileClient_object_player_event_onInventoryOpened = "custom\EnigmaRevive\ExileClient_object_player_event_onInventoryOpened.sqf"; //Happys Revive AntiDupe ---NEW with v0.65
};
//////////////////////////////////////////////////////////////////////////////////////////////////////
Next you will either want to enable the Defibrilator to be purchased at the trader or add it to loot! I did both but just show how to add to trader here.
Go to:
//////////////////////////////////////////////////////////////////////////////////////////////////////
class FirstAid
{
name = "FirstAid";
icon = "a3\ui_f\data\gui\Rsc\RscDisplayArsenal\itemacc_ca.paa";
items[] =
{
"Exile_Item_InstaDoc",
"Exile_Item_Bandage",
"Exile_Item_Vishpirin"
// Not available in 0.9.4!
//"Exile_Item_Defibrillator"
};
};
//////////////////////////////////////////////////////////////////////////////////////////////////////
change it to:
//////////////////////////////////////////////////////////////////////////////////////////////////////
class FirstAid
{
name = "FirstAid";
icon = "a3\ui_f\data\gui\Rsc\RscDisplayArsenal\itemacc_ca.paa";
items[] =
{
"Exile_Item_InstaDoc",
"Exile_Item_Bandage",
"Exile_Item_Vishpirin",
// Used in Enigma Revive!
"Exile_Item_Defibrillator"
};
};
//////////////////////////////////////////////////////////////////////////////////////////////////////
Next:
//////////////////////////////////////////////////////////////////////////////////////////////////////
//class Exile_Item_Defibrillator { quality = 1; price = 7500; };
//////////////////////////////////////////////////////////////////////////////////////////////////////
change to:
//////////////////////////////////////////////////////////////////////////////////////////////////////
class Exile_Item_Defibrillator { quality = 1; price = 7500; };
//////////////////////////////////////////////////////////////////////////////////////////////////////
Players will only get the scroll option to defib the dead player whilst they are bleeding out, and if they are holding a defib! It will show up with the identify body scroll option!
There are a few settings you can modify inside the custom\EnigmaRevive\init.sqf
Note: this includes my add respect/poptabs server function for those who are running it already!