Danke für die schnelle Antwort Vienna und Saint, hätte nicht gedacht dass dies so schnell geht. Dein “ //Wenn Spieler Zivilist, dann Skript verlassen“ hat gepasst. Jetzt hab ich noch das Problem das er es im Auswahlmenü links oben noch anzeigt mit "Waffe ziehen" obwohl ich es ausgeklammert habe.
nochmals Danke
PHP-Code:
// in init.sqf put:
//
// if (!isDedicated) then
// {
// holstered = 0;
// player addAction ["Waffe ziehen","arc_holster.sqf",nil,2.5,false,true,"",""];
// };
if (playerSide == civilian) exitwith {}; //Wenn Spieler Zivilist, dann Skript verlassen
if (isDedicated) exitWith {};
private ["_unit","_holstered"];
_id = _this select 2;
_unit = player;
_holstered = holstered;
switch (_holstered) do
{
case 0:
{
class_weapon = currentWeapon _unit;
if (currentWeapon _unit != handgunWeapon _unit) exitWith
{
hint "Equip your sidearm first!";
};
_unit removeAction _id;
A_mags = [];
_magazinesAmmoFull = magazinesAmmoFull _unit;
for "_i" from 0 to ((count _magazinesAmmoFull)-1) do
{
_type = (_magazinesAmmoFull select _i) select 3;
if(_type == 2) then
{
A_mags = A_mags + [(_magazinesAmmoFull select _i) select 0];
};
};
A_mags = A_mags + [handgunMagazine _unit];
b_count = _unit ammo class_weapon;
_unit removeWeapon "hgun_Pistol_heavy_02_F";
holstered = 1;
_unit addAction ["Waffe ziehen","arc_holster.sqf",nil,2.5,false,true,"",""];
};
case 1:
{
_unit removeAction _id;
for "_i" from 0 to ((count A_mags)-1) do
{
_unit addMagazine (A_mags select _i);
};
_unit addWeapon "hgun_Pistol_heavy_02_F";
_unit setAmmo [handgunWeapon _unit, b_count];
_unit selectWeapon class_weapon;
holstered = 0;
_unit addAction ["Waffe wegstecken","arc_holster.sqf",nil,2.5,false,true,"",""];
};
};
if (true) exitWith {};
[/font]