From 2d5a3effd48cb3053e0beed1595759df5ffeb165 Mon Sep 17 00:00:00 2001 From: happydayz Date: Sun, 3 Jul 2016 21:33:16 +1000 Subject: [PATCH] test update for 0.9.8 --- .../compile/Enigma/Exile_RevivePlayer.sqf | 237 ++++++++---------- ...t_object_player_death_startBleedingOut.sqf | 15 +- 2 files changed, 113 insertions(+), 139 deletions(-) diff --git a/@Enigma/addons/enigma_exile_revive/compile/Enigma/Exile_RevivePlayer.sqf b/@Enigma/addons/enigma_exile_revive/compile/Enigma/Exile_RevivePlayer.sqf index 5fa21b4..7f59ee0 100644 --- a/@Enigma/addons/enigma_exile_revive/compile/Enigma/Exile_RevivePlayer.sqf +++ b/@Enigma/addons/enigma_exile_revive/compile/Enigma/Exile_RevivePlayer.sqf @@ -1,7 +1,9 @@ + + /* Exile_RevivePlayer.sqf [_ZEN_] Happydayz -© 2016 Enigma Team +© 2016 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"]; @@ -14,20 +16,17 @@ _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 { +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 (!isNil "_requestingPlayerUID" && !alive _requestingPlayer) then + { if (_requestingPlayer == _reviver) exitWith { Diag_log format ["Enigma Revive - Attempted hack revive by %1",_requestingPlayer]; }; @@ -41,11 +40,10 @@ if (!local _requestingPlayer) then { }; } 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 (isNil "_reviveused") then {_reviveused = 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]; + if (_reviveused == MaxRevivesAllowed) exitWith{ + EnigmaReviveFail = [_requestingPlayer, _revivername]; _ownerID publicVariableClient "EnigmaReviveFail"; _msgarray = []; @@ -59,55 +57,70 @@ if (!local _requestingPlayer) then { _msg = format ["%1 You killed %2!",_randommsg,_name]; - EnigmaReviveMSG = [_msg]; //make the _reviver kill the player! hehehehe + EnigmaReviveMSG = [_msg]; _reviverownerID publicVariableClient "EnigmaReviveMSG"; }; - if (_requestingPlayer getVariable["REVIVE", true]) then { + 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; + _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; + _handguntype = handgunWeapon _requestingPlayer; + _primaryWeapon = ""; + _secondaryWeapon = ""; - _handgunammo = _requestingPlayer ammo handgunWeapon _requestingPlayer; //counts rounds in magazine inside handgun + _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), [_primaryWeapon, _secondaryWeapon, handgunWeapon _requestingPlayer]]; + hideObjectGlobal _requestingPlayer; + - _handguntype = handgunWeapon _requestingPlayer; + _accountData = format["getAccountStats:%1", _requestingPlayerUID] call ExileServer_system_database_query_selectSingle; + _group = call ExileServer_system_group_getOrCreateLoneWolfGroup; -_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), [_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 = _group createUnit["Exile_Unit_Player", _location, [], 0, "CAN_COLLIDE"]; + removeHeadgear _bambiPlayer; + _bambiPlayer allowDammage false; + _clanID = (_accountData select 3); + if !((typeName _clanID) isEqualTo "SCALAR") then + { + _clanID = -1; + _clanData = []; + } + else + { + _clanData = missionNamespace getVariable [format ["ExileServer_clan_%1",_clanID],[]]; + if(isNull (_clanData select 5))then + { + _clanGroup = createGroup independent; + _clanData set [5,_clanGroup]; + _clanGroup setGroupIdGlobal [_clanData select 0]; + missionNameSpace setVariable [format ["ExileServer_clan_%1",_clanID],_clanData]; + } + else + { + _clanGroup = (_clanData select 5); + }; + [_player] joinSilent _clanGroup; +}; _bambiPlayer setFatigue FatiguewhenRevived; _bambiPlayer setDamage DamageWhenRevived; - _bambiPlayer setDir _dir; _bambiPlayer setPosATL _location; + _bambiPlayer setDir _dir; if (_uniform != "") then {_bambiPlayer addUniform _uniform;}; if (_backpack != "") then {_bambiPlayer addBackpack _backpack;}; @@ -180,38 +193,33 @@ _secondaryWeapon = ""; }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 addMagazine [_handguntype, _handgunammo]; +_bambiPlayer setPosATL [_location select 0,_location select 1,0]; +_bambiPlayer disableAI "FSM"; +_bambiPlayer disableAI "MOVE"; +_bambiPlayer disableAI "AUTOTARGET"; +_bambiPlayer disableAI "TARGET"; +_bambiPlayer disableAI "CHECKVISIBLE"; +_bambiPlayer setDir _dir; _bambiPlayer setName _name; - -if (GR8HumanityInstalled) then { -_bambiPlayer setVariable ["ExileMoney", (_accountData select 0)]; -_bambiPlayer setVariable ["ExileScore", (_accountData select 1)]; -_bambiPlayer setVariable ["ExileHumanity", (_accountData select 2)]; -_bambiPlayer setVariable ["ExileKills", (_accountData select 3)]; -_bambiPlayer setVariable ["ExileDeaths", (_accountData select 4)]; -} else { -_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 ["ExileMoney", 0, true]; +_bambiPlayer setVariable ["ExileScore", (_accountData select 0)]; +_bambiPlayer setVariable ["ExileKills", (_accountData select 1)]; +_bambiPlayer setVariable ["ExileDeaths", (_accountData select 2)]; _bambiPlayer setVariable ["ExileClanID", _clanID]; -_bambiPlayer setVariable ["ExileClanName", _clanName]; -_bambiPlayer setVariable ["ExileHunger", 50]; //ur hungry -_bambiPlayer setVariable ["ExileThirst", 50]; //ur thirsty -_bambiPlayer setVariable ["ExileTemperature", 36]; //ur cold and clammy from death! +_bambiPlayer setVariable ["ExileClanData", _clanData]; +_bambiPlayer setVariable ["ExileHunger", 50]; +_bambiPlayer setVariable ["ExileThirst", 50]; +_bambiPlayer setVariable ["ExileTemperature", 36]; _bambiPlayer setVariable ["ExileWetness", 0]; -_bambiPlayer setVariable ["ExileAlcohol", 0.1]; //ur a little woozy +_bambiPlayer setVariable ["ExileAlcohol", 0]; _bambiPlayer setVariable ["ExileName", _name]; _bambiPlayer setVariable ["ExileOwnerUID", getPlayerUID _requestingPlayer]; _bambiPlayer setVariable ["ExileIsBambi", true]; _bambiPlayer setVariable ["ExileXM8IsOnline", false, true]; +_bambiPlayer setVariable ["ExileLocker", (_accountData select 4), true]; -//diag_log format ["Bambiplayer = %1 --- _sessionID = %2",_bambiPlayer,_sessionID]; private["_player","_playerID","_playerPos","_data","_extDB2Message"]; @@ -279,96 +287,57 @@ _extDB2Message call ExileServer_system_database_query_fireAndForget; } forEach ReviveChk_cache; _reviveused = _reviveused + 1; - ReviveChk_cache set [_ind, [_playerID, _reviveused]]; //add this revive to total number of player revives! + ReviveChk_cache set [_ind, [_playerID, _reviveused]]; + if (_reviveused > MaxRevivesAllowed) then + { + _bambiPlayer setVariable ["REVIVE", false, true]; + }; - //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"; - - -if (GR8HumanityInstalled) then { - -_newScore = _requestingPlayer getVariable ["ExileHumanity", 0]; -_newScore = _newScore; -_requestingPlayer setVariable ["ExileHumanity", _newScore]; -format["setAccountHumanity:%1:%2", _newScore, getPlayerUID _requestingPlayer] call ExileServer_system_database_query_fireAndForget; - -[ - _sessionID, - "loadPlayerResponse", - [ - (netId _player), - str (_player getVariable ["ExileMoney", 0]), - str (_player getVariable ["ExileScore", 0]), - str (_player getVariable ["ExileHumanity", 0]), - (_player getVariable ["ExileKills", 0]), - (_player getVariable ["ExileDeaths", 0]), - (_player getVariable ["ExileHunger", 100]), - (_player getVariable ["ExileThirst", 100]), - (_player getVariable ["ExileAlcohol", 0]), - (_player getVariable ["ExileClanName", ""]), - (_player getVariable ["ExileTemperature", 0]), - (_player getVariable ["ExileWetness", 0]) - ] -] -call ExileServer_system_network_send_to; -[_sessionID, _player] call ExileServer_system_session_update; - - -} else { + _msg = format ["%1 has been stabilised! You have been rewarded 100 Respect!",_name]; + EnigmaReviveMSG = [_msg]; + _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}]; +if (getNumber (configFile >> "CfgSettings" >> "VehicleSpawn" >> "thermalVision") isEqualTo 0) then +{ + _player addEventHandler ["WeaponAssembled", {(_this select 1) disableTIEquipment true;}]; +}; [ - _sessionID, - "loadPlayerResponse", + _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", ""]), + (_player getVariable ["ExileClanData", []]), (_player getVariable ["ExileTemperature", 0]), (_player getVariable ["ExileWetness", 0]) ] -] +] call ExileServer_system_network_send_to; [_sessionID, _player] call ExileServer_system_session_update; -}; - + + [_requestingPlayer] joinSilent ExileServerGraveyardGroup; + deleteVehicle _requestingPlayer; -_player addMPEventHandler ["MPKilled", {_this call ExileServer_object_player_event_onMpKilled}]; - - -_requestingPlayer setposatl [0,0,0]; //reports of body duping still - -_corpseGroup = createGroup independent; //test to prevent dead body still being in players group under certain circumstances -[_requestingPlayer] joinSilent _corpseGroup; -deleteVehicle _requestingPlayer; - - EnigmaRevive = []; + EnigmaRevive = []; _ownerID publicVariableClient "EnigmaRevive"; -_player allowDamage true; //test to fix players having god mode against AI after revive + _player allowDamage true; - }; - + }; }; -}; +}; \ No newline at end of file diff --git a/Exile.Altis/Custom/EnigmaRevive/ExileClient_object_player_death_startBleedingOut.sqf b/Exile.Altis/Custom/EnigmaRevive/ExileClient_object_player_death_startBleedingOut.sqf index facdaa4..44e0f78 100644 --- a/Exile.Altis/Custom/EnigmaRevive/ExileClient_object_player_death_startBleedingOut.sqf +++ b/Exile.Altis/Custom/EnigmaRevive/ExileClient_object_player_death_startBleedingOut.sqf @@ -27,9 +27,9 @@ _descriptions = 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 ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0.39, 0.32, 0.25, 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 ppEffectAdjust [1, 1, 0, [0.4, 0.2, 0.3, 0], [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; @@ -39,6 +39,9 @@ ExileClientPostProcessingBackgroundBlur ppEffectCommit _respawnDelay; ExileClientBleedOutHeartbeatPlaying = false; ExileClientBleedOutCountDownDuration = _respawnDelay; ExileClientBleedOutCountDownEnd = time + _respawnDelay; +_layer = "BIS_fnc_respawnCounter" call bis_fnc_rscLayer; +_layer cutText ["", "plain"]; +_descriptions = player setVariable ["BleedoutCountDownEnd", ExileClientBleedOutCountDownEnd, true]; @@ -55,15 +58,17 @@ if(ExileClientBleedOutThread isEqualTo -1)then { ExileClientBleedOutThread = [2, ExileClient_object_player_thread_bleedToDeath, [], true] call ExileClient_system_thread_addtask; }; -} else { +} +else +{ //////////////////////////////////////////////////////////////////////////////////////// [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 ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0.39, 0.32, 0.25, 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 ppEffectAdjust [1, 1, 0, [0.4, 0.2, 0.3, 0], [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;