Merge pull request #866 from dayz10k/master

melee mags for skinchanges, actions after skinchanges
This commit is contained in:
HARLAN
2013-12-06 08:40:28 -08:00
5 changed files with 42 additions and 4 deletions

View File

@@ -83,6 +83,7 @@ class CfgWeapons {
class ChainSaw: Rifle
{
scope = 2;
melee= "true";
/*
bullet1[] = {"ca\sounds\weapons\shells\big_shell_wood_01",0.0707946,1,15};

View File

@@ -90,6 +90,13 @@ player allowDamage true;
player addWeapon "Loot";
player addWeapon "Flare";
//melee check
_wpnType = primaryWeapon player;
_ismelee = (gettext (configFile >> "CfgWeapons" >> _wpnType >> "melee"));
if (_ismelee == "true") then {
call dayz_meleeMagazineCheck;
};
sleep 0.1;
if (!isNull _old) then {

View File

@@ -208,4 +208,15 @@ diag_log str(getMagazineCargo unitBackpack _newUnit);
_playerUID=getPlayerUID player;
_playerObjName = format["player%1",_playerUID];
call compile format["%1 = player;",_playerObjName];
publicVariable _playerObjName;
publicVariable _playerObjName;
//melee check
_wpnType = primaryWeapon player;
_ismelee = (gettext (configFile >> "CfgWeapons" >> _wpnType >> "melee"));
if (_ismelee == "true") then {
call dayz_meleeMagazineCheck;
};
//reveal all near objects.
{player reveal _x} forEach (nearestObjects [getPosATL player, ["All"], 75]);
//All is arbitrary and will need to be changed to ["AllVehicles","WeaponHolder","tentStorage"] ++ others (stashes etc.)

View File

@@ -432,6 +432,15 @@ if (!isDedicated) then {
endLoadingScreen;
};
dayz_meleeMagazineCheck = {
private["_meleeNum","_magType"];
_magType = ([] + getArray (configFile >> "CfgWeapons" >> _wpnType >> "magazines")) select 0;
_meleeNum = ({_x == _magType} count magazines player);
if (_meleeNum < 1) then {
player addMagazine _magType;
};
};
dayz_originalPlayer = player;
progressLoadingScreen 0.8;
@@ -543,4 +552,4 @@ if (!isDedicated) then {
eh_localCleanup = {};
};
initialized = true;
initialized = true;

View File

@@ -1,4 +1,4 @@
private ["_refObj","_size","_vel","_speed","_hunger","_thirst","_result","_factor","_mylastPos","_distance","_lastTemp","_rnd","_listTalk","_id","_messTimer","_combatdisplay","_combatcontrol","_timeleft","_inVehicle","_lastUpdate","_foodVal","_thirstVal","_lowBlood","_startcombattimer","_combattimeout","_isPZombie","_outsideMap","_radsound","_bloodloss","_radTimer","_currentBlood"];
private ["_refObj","_size","_vel","_speed","_hunger","_thirst","_result","_factor","_mylastPos","_distance","_lastTemp","_rnd","_listTalk","_id","_messTimer","_combatdisplay","_combatcontrol","_timeleft","_inVehicle","_lastUpdate","_foodVal","_thirstVal","_lowBlood","_startcombattimer","_combattimeout","_isPZombie","_outsideMap","_radsound","_bloodloss","_radTimer","_currentBlood","_wpnType"];
disableSerialization;
_messTimer = 0;
@@ -246,9 +246,19 @@ while {true} do {
_combatcontrol ctrlShow true;
};
//Melee Weapons ammo fix
if(isNil {login_ammochecked}) then {
login_ammochecked = true;
_wpnType = primaryWeapon player;
_ismelee = (gettext (configFile >> "CfgWeapons" >> _wpnType >> "melee"));
if (_ismelee == "true") then {
call dayz_meleeMagazineCheck;
};
};
// Blood Effects
"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, (r_player_blood/r_player_bloodTotal)], [1, 1, 1, 0.0]];
"colorCorrections" ppEffectCommit 0;
sleep 2;
};
};