This commit is contained in:
vbawol
2013-01-29 00:36:55 -06:00
parent f0a8b3ddb9
commit f58858c013
14 changed files with 365 additions and 149 deletions

View File

@@ -101,7 +101,7 @@ menu_RU_Citizen3 = [
"friendly" "friendly"
]; ];
// Auto Traders // Auto Traders
menu_CIV_Worker3 = [ menu_Worker3 = [
[["Cars",41],["Trucks Unarmed",42],["SUV",466],["Buses and Vans",467],["Offroad",43],["Helicopter Unarmed",44],["Military Unarmed",45]], [["Cars",41],["Trucks Unarmed",42],["SUV",466],["Buses and Vans",467],["Offroad",43],["Helicopter Unarmed",44],["Military Unarmed",45]],
[], [],
"friendly" "friendly"
@@ -149,7 +149,7 @@ menu_RU_Villager3 = [
menu_TK_CIV_Takistani04_EP1 = [ menu_TK_CIV_Takistani04_EP1 = [
[["Explosives",23]], [["Explosives",23]],
[], [],
"hostile" "neutral"
]; ];
// ["friendly"] must have more than -2000 humanity, // ["friendly"] must have more than -2000 humanity,
@@ -202,6 +202,14 @@ if (isServer) then {
"Ikarus", "Ikarus",
"SUV_TK_CIV_EP1", "SUV_TK_CIV_EP1",
"SUV_Green", "SUV_Green",
"SUV_Yellow",
"SUV_White",
"SUV_Silver",
"SUV_Red",
"SUV_Pink",
"SUV_Orange",
"SUV_Charcoal",
"SUV_Blue",
"UH1H_DZ", "UH1H_DZ",
"Mi17_Civilian", "Mi17_Civilian",
"LandRover_CZ_EP1", "LandRover_CZ_EP1",
@@ -234,6 +242,14 @@ if (isServer) then {
0.01, // "Ikarus" 0.01, // "Ikarus"
0.1, // "SUV_TK_CIV_EP1" 0.1, // "SUV_TK_CIV_EP1"
0.1, // "SUV_Green", 0.1, // "SUV_Green",
0.1, // "SUV_Yellow",
0.1, // "SUV_White",
0.1, // "SUV_Silver",
0.1, // "SUV_Red",
0.1, // "SUV_Pink",
0.1, // "SUV_Orange",
0.1, // "SUV_Charcoal",
0.1, // "SUV_Blue",
0.05, // "UH1H_DZ" 0.05, // "UH1H_DZ"
0.09, // "Mi17_Civilian" 0.09, // "Mi17_Civilian"
0.11, // "LandRover_CZ_EP1" 0.11, // "LandRover_CZ_EP1"
@@ -256,7 +272,7 @@ if (isServer) then {
5, // "datsun1_civil_3_open", 5, // "datsun1_civil_3_open",
3, // "Pickup_PK_TK_GUE_EP1", 3, // "Pickup_PK_TK_GUE_EP1",
2, // "Octavia_ACR" 2, // "Octavia_ACR"
2, // VWGolf 2, // "VWGolf"
3, // "Lada1", 3, // "Lada1",
3, // "Skoda", 3, // "Skoda",
3, // "car_sedan", 3, // "car_sedan",
@@ -266,6 +282,14 @@ if (isServer) then {
2, // "Ikarus" 2, // "Ikarus"
4, // "SUV_TK_CIV_EP1" 4, // "SUV_TK_CIV_EP1"
2, // "SUV_Green", 2, // "SUV_Green",
1, // "SUV_Yellow",
1, // "SUV_White",
1, // "SUV_Silver",
1, // "SUV_Red",
1, // "SUV_Pink",
1, // "SUV_Orange",
1, // "SUV_Charcoal",
1, // "SUV_Blue",
2, // "UH1H_DZ" 2, // "UH1H_DZ"
2, // "Mi17_Civilian" 2, // "Mi17_Civilian"
2, // "LandRover_CZ_EP1" 2, // "LandRover_CZ_EP1"

View File

@@ -47,6 +47,7 @@ if (_section and _hasToolbox) then {
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = []; {dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
dayz_myCursorTarget = objNull; dayz_myCursorTarget = objNull;
s_player_repair_crtl = -1;
//check if repaired fully //check if repaired fully
_hitpoints = _vehicle call vehicle_getHitpoints; _hitpoints = _vehicle call vehicle_getHitpoints;

View File

@@ -0,0 +1,64 @@
private["_activatingPlayer","_trader_id","_category","_action","_id","_type","_loc","_name","_qty","_cost","_qty","_sell","_cur","_order","_tid","_currency","_actionFile","_in","_out","_part","_cat","_cancel","_Display","_File","_textCurrency","_textPart"];
// [ _trader_id, _category, _action ];
_activatingPlayer = _this select 1;
_vehicle = _this select 3;
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
// dayz_myCursorTarget = _vehicle;
_allFixed = true;
_hitpoints = _vehicle call vehicle_getHitpoints;
{
_damage = [_vehicle,_x] call object_getHit;
_part = "PartGeneric";
//change "HitPart" to " - Part" rather than complicated string replace
_cmpt = toArray (_x);
_cmpt set [0,20];
_cmpt set [1,toArray ("-") select 0];
_cmpt set [2,20];
_cmpt = toString _cmpt;
if(["Engine",_x,false] call fnc_inString) then {
_part = "PartEngine";
};
if(["HRotor",_x,false] call fnc_inString) then {
_part = "PartVRotor"; //yes you need PartVRotor to fix HRotor LOL
};
if(["Fuel",_x,false] call fnc_inString) then {
_part = "PartFueltank";
};
if(["Wheel",_x,false] call fnc_inString) then {
_part = "PartWheel";
};
if(["Glass",_x,false] call fnc_inString) then {
_part = "PartGlass";
};
// get every damaged part no matter how tiny damage is!
if (_damage > 0) then {
_allFixed = false;
_color = "color='#ffff00'"; //yellow
if (_damage >= 0.5) then {_color = "color='#ff8800'";}; //orange
if (_damage >= 0.9) then {_color = "color='#ff0000'";}; //red
_string = format["<t %2>Repair%1</t>",_cmpt,_color]; //Repair - Part
_handle = dayz_myCursorTarget addAction [_string, "\z\addons\dayz_code\actions\repair.sqf",[_vehicle,_part,_x], 0, false, true, "",""];
s_player_repairActions set [count s_player_repairActions,_handle];
};
} forEach _hitpoints;
if (_allFixed) then {
_vehicle setDamage 0;
};
s_player_repair_crtl = 1;

View File

@@ -0,0 +1,57 @@
private["_vehicle","_part","_hitpoint","_type","_selection","_array"];
_id = _this select 2;
_array = _this select 3;
_vehicle = _array select 0;
_part = _array select 1;
_hitpoint = _array select 2;
_type = typeOf _vehicle;
//
_hasToolbox = "ItemToolbox" in items player;
// moving this here because we need to know which part needed if we don't have it
_nameType = getText(configFile >> "cfgVehicles" >> _type >> "displayName");
_namePart = getText(configFile >> "cfgMagazines" >> _part >> "displayName");
if (_hasToolbox) then {
_damage = [_vehicle,_hitpoint] call object_getHit;
_vehicle removeAction _id;
//dont allow removal of damaged parts
if (_damage < 0.15) then {
_isOK = [player,_part] call BIS_fnc_invAdd;
if (_isOK) then {
//Fix the part
_selection = getText(configFile >> "cfgVehicles" >> _type >> "HitPoints" >> _hitpoint >> "name");
//vehicle is owned by whoever is in it, so we have to have each client try and fix it
["dayzSetFix",[_vehicle,_selection,1],_vehicle] call broadcastRpcCallIfLocal;
player playActionNow "Medic";
sleep 1;
[player,"repair",0,false] call dayz_zombieSpeak;
null = [player,50,true,(getPosATL player)] spawn player_alertZombies;
sleep 5;
_vehicle setvelocity [0,0,1];
//Success!
cutText [format["You have successfully removed %1 from the %2",_namePart,_nameType], "PLAIN DOWN"];
};
};
} else {
cutText [format["You need %1 to remove this part.",_namePart], "PLAIN DOWN"];
};
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
dayz_myCursorTarget = objNull;
s_player_repair_crtl = -1;

View File

@@ -0,0 +1,62 @@
private["_activatingPlayer","_trader_id","_category","_action","_id","_type","_loc","_name","_qty","_cost","_qty","_sell","_cur","_order","_tid","_currency","_actionFile","_in","_out","_part","_cat","_cancel","_Display","_File","_textCurrency","_textPart"];
// [ _trader_id, _category, _action ];
_activatingPlayer = _this select 1;
_vehicle = _this select 3;
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
// dayz_myCursorTarget = _vehicle;
_allFixed = true;
_hitpoints = _vehicle call vehicle_getHitpoints;
{
_damage = [_vehicle,_x] call object_getHit;
_part = "PartGeneric";
//change "HitPart" to " - Part" rather than complicated string replace
_cmpt = toArray (_x);
_cmpt set [0,20];
_cmpt set [1,toArray ("-") select 0];
_cmpt set [2,20];
_cmpt = toString _cmpt;
if(["Engine",_x,false] call fnc_inString) then {
_part = "PartEngine";
};
if(["HRotor",_x,false] call fnc_inString) then {
_part = "PartVRotor"; //yes you need PartVRotor to fix HRotor LOL
};
if(["Fuel",_x,false] call fnc_inString) then {
_part = "PartFueltank";
};
if(["Wheel",_x,false] call fnc_inString) then {
_part = "PartWheel";
};
if(["Glass",_x,false] call fnc_inString) then {
_part = "PartGlass";
};
// allow removal of any lightly damaged parts
if (_damage < 0.25) then {
// Do not allow removal of engine or fueltanks
if( _part == "PartGlass" or _part == "PartWheel" ) then {
_color = "color='#ff0000'"; //red
_string = format["<t %2>Remove %1</t>",_cmpt,_color]; //Remove - Part
_handle = dayz_myCursorTarget addAction [_string, "\z\addons\dayz_code\actions\salvage.sqf",[_vehicle,_part,_x], 0, false, true, "",""];
s_player_repairActions set [count s_player_repairActions,_handle];
};
};
} forEach _hitpoints;
s_player_repair_crtl = 1;

View File

@@ -0,0 +1,37 @@
private["_vehicle","_curFuel","_newFuel","_timeLeft"];
_vehicle = cursorTarget;
_canSize = getNumber(configFile >> "cfgMagazines" >> "ItemJerrycan" >> "fuelQuantity");
_configVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicle);
_capacity = getNumber(_configVeh >> "fuelCapacity");
_nameType = getText(_configVeh >> "displayName");
_curFuel = ((fuel _vehicle) * _capacity);
_newFuel = (_curFuel - _canSize);
// calculate minimum needed fuel
_newFuel = (_newFuel / _capacity);
if (_newFuel > 0) then {
player removeMagazine "ItemJerrycanEmpty";
player addMagazine "ItemJerrycan";
player playActionNow "Medic";
[player,"refuel",0,false] call dayz_zombieSpeak;
_id = [player,20,true,(getPosATL player)] spawn player_alertZombies;
sleep 6;
//apply newFuel to vehicle on every peer
["dayzSetFuel",[_vehicle,_newFuel]] call broadcastRpcCallAll;
cutText [format["%1 has been drained for %2 litres of Fuel",_nameType,_canSize], "PLAIN DOWN"];
sleep 1;
call fnc_usec_medic_removeActions;
r_action = false;
} else {
cutText [format["%1 has no fuel.",_nameType], "PLAIN DOWN"];
};

View File

@@ -21,15 +21,7 @@ if (_qty >= _qty_in) then {
_bos = 1; _bos = 1;
}; };
_isOk = false;
if(_buy_o_sell == "buy") then {
_config = (configFile >> "cfgMagazines" >> _part_out);
_isOk = [player,_config] call BIS_fnc_invAdd;
} else {
_isOk = true;
};
if (_isOk) then {
["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure; ["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
@@ -56,10 +48,6 @@ if (_qty >= _qty_in) then {
dayzTradeResult = nil; dayzTradeResult = nil;
} else {
cutText [localize "STR_DAYZ_CODE_2", "PLAIN DOWN"];
};
} else { } else {
_needed = _qty_in - _qty; _needed = _qty_in - _qty;

View File

@@ -1,4 +1,4 @@
private["_iarray","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_textPartIn","_textPartOut","_bos"]; private["_activatingPlayer","_part_out","_part_in","_qty_out","_qty_in","_buy_o_sell","_textPartIn","_textPartOut","_traderID","_counter","_failed","_qty","_isOk","_needed"];
// [part_out,part_in, qty_out, qty_in,]; // [part_out,part_in, qty_out, qty_in,];
//_activatingPlayer = _this select 1; //_activatingPlayer = _this select 1;
@@ -12,34 +12,44 @@ _textPartIn = (_this select 3) select 5;
_textPartOut = (_this select 3) select 6; _textPartOut = (_this select 3) select 6;
//_traderID = (_this select 3) select 7; //_traderID = (_this select 3) select 7;
_counter = 0;
_failed = false;
_qty = {_x == _part_in} count magazines player; _qty = {_x == _part_in} count magazines player;
if (_qty >= _qty_in) then { if (_qty >= _qty_in) then {
_isOk = false; // Take currency
if(_buy_o_sell == "buy") then {
_config = (configFile >> "cfgMagazines" >> _part_out);
_isOk = [player,_config] call BIS_fnc_invAdd;
} else {
_isOk = true;
};
if (_isOk) then {
for "_x" from 1 to _qty_in do { for "_x" from 1 to _qty_in do {
player removeMagazine _part_in; player removeMagazine _part_in;
}; };
// check for space if buying and do not check if selling
for "_x" from 1 to _qty_out do { for "_x" from 1 to _qty_out do {
if(_buy_o_sell == "buy") then {
_isOk = [player,_part_out] call BIS_fnc_invAdd;
if (!_isOk) exitWith { _failed = true; };
_counter = _counter + 1;
} else {
player addMagazine _part_out; player addMagazine _part_out;
}; };
// [player,"repair",0,false] call dayz_zombieSpeak;
cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
} else {
cutText [localize "STR_DAYZ_CODE_2", "PLAIN DOWN"];
}; };
// revert trade since it failed
if(_failed) then {
// add back currency
for "_x" from 1 to _qty_in do {
player addMagazine _part_in;
};
// remove partial trade
for "_x" from 1 to _counter do {
player removeMagazine _part_out;
};
cutText [localize "STR_DAYZ_CODE_2", "PLAIN DOWN"];
} else {
cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
};
} else { } else {
_needed = _qty_in - _qty; _needed = _qty_in - _qty;
cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"]; cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"];

View File

@@ -23,17 +23,8 @@ if(_buy_o_sell == "buy") then {
if (_qty >= _qty_in) then { if (_qty >= _qty_in) then {
_isOk = false;
if(_buy_o_sell == "buy") then {
_config = (configFile >> "cfgWeapons" >> _part_out);
_isOk = [player,_config] call BIS_fnc_invAdd;
} else {
_isOk = true;
};
if (_isOk) then {
["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure; ["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
waitUntil {!isNil "dayzTradeResult"}; waitUntil {!isNil "dayzTradeResult"};
@@ -69,9 +60,7 @@ if (_qty >= _qty_in) then {
cutText [format[("Insufficient Stock %1"),_textPartOut] , "PLAIN DOWN"]; cutText [format[("Insufficient Stock %1"),_textPartOut] , "PLAIN DOWN"];
}; };
dayzTradeResult = nil; dayzTradeResult = nil;
} else {
cutText [localize "STR_DAYZ_CODE_2", "PLAIN DOWN"];
};
} else { } else {
_needed = _qty_in - _qty; _needed = _qty_in - _qty;

View File

@@ -58,6 +58,7 @@ if (_hasPatient and !r_drag_sqf and !r_action and !_inVehicle and !r_player_unco
_hasBlood = "ItemBloodbag" in magazines player; _hasBlood = "ItemBloodbag" in magazines player;
_hasToolbox = "ItemToolbox" in items player; _hasToolbox = "ItemToolbox" in items player;
_hasJerry = "ItemJerrycan" in magazines player; _hasJerry = "ItemJerrycan" in magazines player;
_hasJerryE = "ItemJerrycanEmpty" in magazines player;
_hasEtool = "ItemEtool" in weapons player; _hasEtool = "ItemEtool" in weapons player;
_hasWire = "ItemWire" in magazines player; _hasWire = "ItemWire" in magazines player;
_hasPainkillers = "ItemPainkiller" in magazines player; _hasPainkillers = "ItemPainkiller" in magazines player;
@@ -126,6 +127,13 @@ if (_hasPatient and !r_drag_sqf and !r_action and !_inVehicle and !r_player_unco
_action = _unit addAction [format[localize "str_actions_medical_10",_typeVeh], "\z\addons\dayz_code\actions\refuel.sqf",[_unit], 0, true, true, "", "'ItemJerrycan' in magazines player"]; _action = _unit addAction [format[localize "str_actions_medical_10",_typeVeh], "\z\addons\dayz_code\actions\refuel.sqf",[_unit], 0, true, true, "", "'ItemJerrycan' in magazines player"];
r_player_actions set [count r_player_actions,_action]; r_player_actions set [count r_player_actions,_action];
}; };
//CAN WE siphon fuel from THE OBJECT?
if ((fuel _unit > 0) and _hasJerryE) then {
r_action = true;
_action = _unit addAction [format["Siphon fuel from %1",_typeVeh], "\z\addons\dayz_code\actions\siphonFuel.sqf",[_unit], 0, true, true, "", "'ItemJerrycanEmpty' in magazines player"];
r_player_actions set [count r_player_actions,_action];
};
//CAN WE ISSUE ANOTHER KIND OF AMMUNITION? //CAN WE ISSUE ANOTHER KIND OF AMMUNITION?
if (count weapons _unit > 0) then { if (count weapons _unit > 0) then {
//Get mag array //Get mag array

View File

@@ -231,65 +231,38 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 4))
s_player_sleep = -1; s_player_sleep = -1;
}; };
//Repairing Vehicles //Repairing Vehicles
if ((dayz_myCursorTarget != cursorTarget) and !_isMan and _hasToolbox and (damage cursorTarget < 1)) then { if (_isVehicle and (dayz_myCursorTarget != cursorTarget) and !_isMan and _hasToolbox and (damage cursorTarget < 1)) then {
if (s_player_repair_crtl < 0) then {
_vehicle = cursorTarget; _vehicle = cursorTarget;
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
dayz_myCursorTarget = _vehicle; dayz_myCursorTarget = _vehicle;
_allFixed = true; _menu = dayz_myCursorTarget addAction ["Repair Vehicle", "\z\addons\dayz_code\actions\repair_vehicle.sqf",_vehicle, 0, true, false, "",""];
_hitpoints = _vehicle call vehicle_getHitpoints; _menu1 = dayz_myCursorTarget addAction ["Salvage Vehicle", "\z\addons\dayz_code\actions\salvage_vehicle.sqf",_vehicle, 0, true, false, "",""];
{ s_player_repairActions set [count s_player_repairActions,_menu];
_damage = [_vehicle,_x] call object_getHit; s_player_repairActions set [count s_player_repairActions,_menu1];
_part = "PartGeneric";
//change "HitPart" to " - Part" rather than complicated string replace s_player_repair_crtl = 1;
_cmpt = toArray (_x);
_cmpt set [0,20];
_cmpt set [1,toArray ("-") select 0];
_cmpt set [2,20];
_cmpt = toString _cmpt;
if(["Engine",_x,false] call fnc_inString) then { } else {
_part = "PartEngine"; {dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
}; s_player_repair_crtl = -1;
if(["HRotor",_x,false] call fnc_inString) then {
_part = "PartVRotor"; //yes you need PartVRotor to fix HRotor LOL
};
if(["Fuel",_x,false] call fnc_inString) then {
_part = "PartFueltank";
};
if(["Wheel",_x,false] call fnc_inString) then {
_part = "PartWheel";
};
if(["Glass",_x,false] call fnc_inString) then {
_part = "PartGlass";
};
// get every damaged part no matter how tiny damage is!
if (_damage > 0) then {
_allFixed = false;
_color = "color='#ffff00'"; //yellow
if (_damage >= 0.5) then {_color = "color='#ff8800'";}; //orange
if (_damage >= 0.9) then {_color = "color='#ff0000'";}; //red
_string = format["<t %2>Repair%1</t>",_cmpt,_color]; //Repair - Part
_handle = dayz_myCursorTarget addAction [_string, "\z\addons\dayz_code\actions\repair.sqf",[_vehicle,_part,_x], 0, false, true, "",""];
s_player_repairActions set [count s_player_repairActions,_handle];
};
} forEach _hitpoints;
if (_allFixed) then {
_vehicle setDamage 0;
}; };
}; };
_humanity = player getVariable ["humanity",0]; _humanity = player getVariable ["humanity",0];
@@ -422,6 +395,8 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 4))
} else { } else {
//Engineering //Engineering
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = []; {dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
s_player_repair_crtl = -1;
dayz_myCursorTarget = objNull; dayz_myCursorTarget = objNull;
{player removeAction _x} forEach s_player_madsci;s_player_madsci = []; {player removeAction _x} forEach s_player_madsci;s_player_madsci = [];

View File

@@ -33,7 +33,7 @@ class CfgMods
hidePicture = 0; hidePicture = 0;
hideName = 0; hideName = 0;
action = "http://www.dayepoch.com"; action = "http://www.dayepoch.com";
version = "0.796"; version = "0.8";
hiveVersion = 0.96; //0.93 hiveVersion = 0.96; //0.93
}; };
}; };

View File

@@ -105,6 +105,7 @@ dayz_resetSelfActions = {
s_player_warndog = -1; s_player_warndog = -1;
s_player_followdog = -1; s_player_followdog = -1;
s_last_trader = -1; s_last_trader = -1;
s_player_repair_crtl = -1;
}; };
call dayz_resetSelfActions; call dayz_resetSelfActions;

View File

@@ -87,7 +87,7 @@ class RscDisplayMain : RscStandardDisplay
class DAYZ_Version : CA_Version class DAYZ_Version : CA_Version
{ {
idc = -1; idc = -1;
text = "DayZ Epoch 0.796 (1.7.5.M1D25)"; text = "DayZ Epoch 0.8 (1.7.5.M1D25)";
y = "(SafeZoneH + SafeZoneY) - (1 - 0.95)"; y = "(SafeZoneH + SafeZoneY) - (1 - 0.95)";
}; };
class CA_TitleMainMenu; class CA_TitleMainMenu;