deploy bike fix

This commit is contained in:
Fallingsheep1985 2015-02-16 13:13:08 +11:00
parent 2881b43f5e
commit b5187b1f0d
2 changed files with 36 additions and 10 deletions

View File

@ -7,16 +7,42 @@
if ("ItemScraps" in magazines player) then{
if ("ToolKit" in magazines player) then{
player removeMagazine "ItemScraps";
if (!isNil 'EPOCH_server_setVToken') then {_vehObj call EPOCH_server_setVToken;};
if (!isNil 'EPX_server_setVToken') then {_vehObj call EPX_server_setVToken; };
_spawn = "ebike_epoch";
_posplr = [((getPos player) select 0) + 2, ((getPos player) select 1) + 2, 0];
_vehClass = "ebike_epoch";
_position = [((getPos player) select 0) + 2, ((getPos player) select 1) + 2, 0];
_saveVehicle call EPOCH_server_save_vehicle;
_dirplr = getDir player;
_spwnveh = _spawn createVehicle (_posplr);
_spwnveh setVariable ["Sarge",1,true];
_vehObj call EPOCH_server_save_vehicle;
_dir = getDir player;
_vehObj = _vehClass createVehicle (_position);
if (!isNil 'EPX_server_vehicleInit') then {_vehObj call EPX_server_vehicleInit};
EPOCH_VehicleSlotsLimit = EPOCH_VehicleSlotsLimit + 1;
EPOCH_VehicleSlots pushBack str(EPOCH_VehicleSlotsLimit);
_slot = EPOCH_VehicleSlots select 0;
_vehObj setVariable ['VEHICLE_SLOT',_slot,true];
EPOCH_VehicleSlots = EPOCH_VehicleSlots - [_slot];
EPOCH_VehicleSlotCount = count EPOCH_VehicleSlots;
publicVariable 'EPOCH_VehicleSlotCount';
clearWeaponCargoGlobal _vehObj;
clearMagazineCargoGlobal _vehObj;
clearBackpackCargoGlobal _vehObj;
clearItemCargoGlobal _vehObj;
_config = (configFile >> 'CfgVehicles' >> _vehClass >> 'availableColors');
if (isArray(_config)) then{_textureSelectionIndex = configFile >> 'CfgVehicles' >> _vehClass >> 'textureSelectionIndex';
_selections = if (isArray(_textureSelectionIndex)) then {getArray(_textureSelectionIndex)} else { [0] };
_colors = getArray(_config);
_textures = _colors select 0;
_color = floor (random (count _textures));
_count = (count _colors)-1;
{
if (_count >= _forEachIndex) then{_textures = _colors select _forEachIndex;};
_vehObj setObjectTextureGlobal [_x, (_textures select _color)];
} forEach _selections;
_vehObj setVariable ['VEHICLE_TEXTURE',_color];
};
if (!isNil 'EPOCH_server_save_vehicle') then {_vehObj call EPOCH_server_save_vehicle};
if (!isNil 'EPX_server_save_vehicle') then {_vehObj call EPX_server_save_vehicle;};
_vehObj call EPOCH_server_setVToken;
player playActionNow "Medic";

View File

@ -10,5 +10,5 @@ if (("ItemScraps" in magazines player)&&("jerrycan_epoch" in magazines player)&&
_target = cursorTarget;
_isbike = _target isKindOf "ebike_epoch";
if (_isbike) then{
player addaction [("<t color=""#0074E8"">" + ("PackBike") +"</t>"),"custom\packbike2.sqf","",5,false,true,"",""];
act = player addaction [("<t color=""#0074E8"">" + ("PackBike") +"</t>"),"custom\packbike2.sqf","",5,false,true,"",""];
};