Help Thread for Epoch Remove Weapons

Dunno how to fix it.
Now I have this:
_object = createVehicle [_class, _location, [], 0, "CAN_COLLIDE"];
};
if (_object isKindOf "AN2_DZ") then {
_object addWeapon "TwinVickers";
_object addMagazine "500Rnd_TwinVickers";
};

if (_object isKindOf "ArmoredSUV_PMC_DZE") then {
_object removeWeapon "M134";
_object removeMagazine "2000Rnd_762x51_M134";
_object addWeapon "PKT";
_object addMagazine "100Rnd_762x54_PK";
};
and this:
_newobject = createVehicle [_class, [0,0,0], [], 0, "CAN_COLLIDE"];
if (_newobject isKindOf "AN2_DZ") then {
_newobject addWeapon "TwinVickers";
_newobject addMagazine "500Rnd_TwinVickers";
};

if (_newobject isKindOf "ArmoredSUV_PMC_DZE") then {
_newobject removeWeapon "M134";
_newobject removeMagazine "2000Rnd_762x51_M134";
_newobject addWeapon "PKT";
_newobject addMagazine "100Rnd_762x54_PK";
};

is it wrong? am i missed something?
 
Dunno how to fix it.
Now I have this:
_object = createVehicle [_class, _location, [], 0, "CAN_COLLIDE"];
};
if (_object isKindOf "AN2_DZ") then {
_object addWeapon "TwinVickers";
_object addMagazine "500Rnd_TwinVickers";
};

if (_object isKindOf "ArmoredSUV_PMC_DZE") then {
_object removeWeapon "M134";
_object removeMagazine "2000Rnd_762x51_M134";
_object addWeapon "PKT";
_object addMagazine "100Rnd_762x54_PK";
};
and this:
_newobject = createVehicle [_class, [0,0,0], [], 0, "CAN_COLLIDE"];
if (_newobject isKindOf "AN2_DZ") then {
_newobject addWeapon "TwinVickers";
_newobject addMagazine "500Rnd_TwinVickers";
};

if (_newobject isKindOf "ArmoredSUV_PMC_DZE") then {
_newobject removeWeapon "M134";
_newobject removeMagazine "2000Rnd_762x51_M134";
_newobject addWeapon "PKT";
_newobject addMagazine "100Rnd_762x54_PK";
};

is it wrong? am i missed something?
Bump. Still have a problem with that.
 
Ok wait what.
Schwede as much as I like and respect your work.... What have you done here :D. (Not taken to seriously pls)
He already got the call for the trader spawned vehicles in there but he probably didn't include it in server_functions.sqf.
So Dess, my advise for you:
Get clean publish vehicle files and start over. Follow the instruction exactly as they are posted in the thread. One step by one, then you will probably see the error.
On the other hand, if you would post your server_functions here than we can check whether the error is there.
But yeah, just go over it again.

Much love for Schwede <3.
 
XD whooopsie daisy sry mate, just thought I will help you with your support :D
It just works for me as told him :)
 
Yeah, that's right. As I posted some days ago, i changed both of files as Schwede said. But what do you mean about server_functions? I have no idea what I should do with it, so I have default server_functions file without any changes on it. :D
 
OK there is probably your problem. In my instruction I say this:
Go to your server_functions.sqf and add this right after the fnc_plyrHit...... Code:
//Fnc for removing weapon by Siothie gaming
fnc_remWepSG = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\fnc_remWepSG.sqf";

So try to do that and we will see how it works out for you.

But try to use the piece of code from my instructions:
http://opendayz.net/threads/release...ion-thermal-from-vehicle-epoch-version.18044/

Since it has a better format and it is 100% right.
 
J3T, thanks for your reply. Script is working fine for me since last week. Maybe I was not correct when wrote some last posts, but I have a problem with spawning vehicles using infiSTAR. All vehicles obtained by traders or spawned by server have replaced weapons and work fine. But if I spawning any vehicle using infi, I'll get vehicle with default weapon on it. I am tried to call this function inside infiSTAR config file AH.sqf, but it has no effect. For now I tried to do this:
Code:
adminsveh =
    { 
        call fnc_remWepSG;
        _dir = getdir vehicle player;
        _pos = getPos vehicle player;
        _pos = [(_pos select 0)+8*sin(_dir),(_pos select 1)+8*cos(_dir),0];
        PVAH_AdminReq = [0, player, _this select 0, _pos];
        publicVariableServer "PVAH_AdminReq";
     
        cutText [format["Spawned until next restart: %1 @%2",_this select 0,_pos], "PLAIN DOWN"];
    };
    adminsvehhive =
    {
        call fnc_remWepSG;
        _class =         _this select 0;
        _dir =             getdir vehicle player;
        _pos =             getPos vehicle player;
        _pos =             [(_pos select 0)+8*sin(_dir),(_pos select 1)+8*cos(_dir),0];
        _worldspace =     [_dir,_pos];
     
        if(MOD_EPOCH) then
        {
            _keyColor =     ["Green","Red","Blue","Yellow","Black"] call BIS_fnc_selectRandom;
            _keyNumber =     (floor(random 2500)) + 1;
            _keySelected =     format[("ItemKey%1%2"),_keyColor,_keyNumber];
            _isKeyOK =         isClass(configFile >> "CfgWeapons" >> _keySelected);
            _config =         _keySelected;
            _isOk =         [player,_config] call BIS_fnc_invAdd;
         
            PVAH_AdminReq = [-3, player, _class, _worldspace,_keySelected];
            publicVariableServer "PVAH_AdminReq";
            cutText [format["Spawned with a key (saved in server DB): %1 @%2\n%3 added to inventory.",_class,_worldspace,_keySelected], "PLAIN DOWN"];
        }
        else
        {
            PVAH_AdminReq = [-1, player, _class, _pos];
            publicVariableServer "PVAH_AdminReq";
            cutText [format["Spawned with a key (saved in server DB): %1 @%2",_class,_worldspace], "PLAIN DOWN"];
        };
    };
Any ideas how to make this function work correctly when I'm trying to spawn vehicles with replaced weapons using infiSTAR?
 
No errors in RPT file, but placing script below the cutText command in code fragment at my last post makes no effect. Vehicles still spawning using infistar with default weapons.
 
Hmm... then this must be the wrong area to add it in then.
Search for == 0 (maybe without space) and check if there is something with createvehicle and add the call in there instead, same thing with == -3
 
Found this lines:
fnc_AdminReqProceed =
{
diag_log format['[AntiHack] - [fnc_AdminReqProceed Array]: %1',_array];
if (_option == 0) then
{
_sl = format["Player %1 (%2) spawned until next restart %3 @%4 (Admin functions)",_clientName,_clientUID,(_array select 2), mapGridPosition _playerObj];
PVAH_WriteLogReq = [_playerObj,toArray _sl];
publicVariableServer 'PVAH_WriteLogReq';

[(_array select 2),(_array select 3),_playerObj] spawn
{
_type = _this select 0;
_pos = _this select 1;
_player = _this select 2;
_dirPlr = getDir _player;
_object = _type createVehicle _pos;
_key = "";
{
_x = _x * 10;
if ( _x < 0 ) then { _x = _x * -10 };
_key = _key + str(round(_x));
} count _pos;
_key = _key + str(round(_dirPlr));
_object setVariable["ObjectID", "0", true];
_object setVariable["ObjectUID", _key, true];
_object setvelocity [0,0,1];
clearWeaponCargoGlobal _object;
clearMagazineCargoGlobal _object;
_object setDir _dirPlr;
if (!isNil "dayz_serverObjectMonitor")then{dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];};
if (!isNil "PVDZE_serverObjectMonitor")then{PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_object];};
};
};
if (_option == -3) then
{
_class = (_array select 2);
_worldspace = (_array select 3);
_keySelected = (_array select 4);

_location = _worldspace select 1;
_object = _class createVehicle _location;
_object setDir (_worldspace select 0);

_characterID = str(getNumber(configFile >> "CfgWeapons" >> _keySelected >> "keyid"));
_uid = _worldspace call dayz_objectUID3;
_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, 0 , _characterID, _worldspace, [], [], 1,_uid];
_key call server_hiveWrite;

[_object,_uid,_characterID,_class] spawn
{
_object = _this select 0;
_uid = _this select 1;
_characterID = _this select 2;
_class = _this select 3;

_done = false;
_retry = 0;
while {_retry < 10} do
{
uiSleep 0.3;
_key = format["CHILD:388:%1:",_uid];
_result = _key call server_hiveReadWrite;
_outcome = _result select 0;
if (_outcome == "PASS") then
{
_oid = _result select 1;
_object setVariable["ObjectID", _oid, true];
_done = true;
_retry = 100;
}
else
{
_done = false;
_retry = _retry + 1;
};
};

_object setvelocity [0,0,1];
_object setVehicleLock "LOCKED";
if (_object isKindOf "Bicycle") then
{
_object setVehicleLock "UNLOCKED";
};
clearWeaponCargoGlobal _object;
clearMagazineCargoGlobal _object;
_object allowDamage false;
_object setVariable["lastUpdate",time];
_object setVariable["CharacterID", _characterID, true];
if (!isNil "dayz_serverObjectMonitor")then{dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];};
if (!isNil "PVDZE_serverObjectMonitor")then{PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_object];};
uiSleep 1;

_object call fnc_veh_ResetEH;
PVDZE_veh_Init = _object;
publicVariable "PVDZE_veh_Init";
[_object,"all"] spawn server_updateObject;
_object allowDamage true;
};
_sl = format["Player %1 (%2) spawned with a key (saved in DB) %3 @%4 (Admin function)",_clientName,_clientUID,_class,_worldspace];
PVAH_WriteLogReq = [_playerObj,toArray _sl];
publicVariableServer 'PVAH_WriteLogReq';
};

As I see, vehicle spawn function calls this script, so I think you mean this.

UPD: Got it! Where is a correct lines for infi
[(_array select 2),(_array select 3),_playerObj] spawn
{
_type = _this select 0;
_pos = _this select 1;
_player = _this select 2;
_dirPlr = getDir _player;
_object = _type createVehicle _pos;
call fnc_remWepSG;
_key = "";
{
_x = _x * 10;
if ( _x < 0 ) then { _x = _x * -10 };
_key = _key + str(round(_x));
} count _pos;
 
Last edited:
Just add the classname into the lower part of the script. And obviously it needs to be activated. But beware this feature is still (and probably will forever be) in alpha stage.
 
if (vehicle player != player) then {

_turretmags = vehicle player magazinesTurret [-1];

{

vehicle player removeMagazineTurret [_x,[-1]];

} forEach _turretmags;

};

This code will remove all ammo from the pilot including hydras
 
Back
Top