Jump to content
  • 0

Drop all your weapons script


Galian

Question

Hello everyone, I m working in a very simple script to allow Epoch players to surrender and drop their reapons on the ground.

 

I have managed to make it work in a SP mission with the following code:

_myStuff = weapons player;
_myMags = magazines player;


// Drop all your stuff on ground.
if (count (_myStuff+_myMags)>0) then 
{
_box = createVehicle ["groundWeaponHolder", player modelToWorld [0,0.8,0], [], 0.5, "CAN_COLLIDE"];
_box setDir floor (random 360);


{
_box addWeaponCargoGlobal [_x, 1];
player removeWeapon _x;
} forEach _myStuff;
{
_box addMagazineCargoGlobal [_x, 1];
player removeItem _x; 
} forEach _myMags;


player reveal _box;
};

The problem comes when I try to make it work in the dedicated epoch server. After searching I found that addAction is not allowed by the epoch system, so my question is: Is there a way to execute this script pressing a key?

 

Thanks for your help, and excuse me if its a noobish question, I have been looking quite a bit now, and cant find a way to make this work.

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

Yes there are plenty of ways to use a Hotkey for a script.

With your permission I will add this to my Donkey Menu GUI, which is setup on a Hotkey already.

I am putting all the script together right now getting ready for release after initial testing.

great idea too

Link to comment
Share on other sites

  • 0

 

Hello everyone, I m working in a very simple script to allow Epoch players to surrender and drop their reapons on the ground.

 

I have managed to make it work in a SP mission with the following code:

_myStuff = weapons player;
_myMags = magazines player;


// Drop all your stuff on ground.
if (count (_myStuff+_myMags)>0) then 
{
_box = createVehicle ["groundWeaponHolder", player modelToWorld [0,0.8,0], [], 0.5, "CAN_COLLIDE"];
_box setDir floor (random 360);


{
_box addWeaponCargoGlobal [_x, 1];
player removeWeapon _x;
} forEach _myStuff;
{
_box addMagazineCargoGlobal [_x, 1];
player removeItem _x; 
} forEach _myMags;


player reveal _box;
};

The problem comes when I try to make it work in the dedicated epoch server. After searching I found that addAction is not allowed by the epoch system, so my question is: Is there a way to execute this script pressing a key?

 

Thanks for your help, and excuse me if its a noobish question, I have been looking quite a bit now, and cant find a way to make this work.

 

you can switch the check off for addactions in the default antihack.

 

im not sure if this is supposed to drop every item the player has or just the weapons, but if you want to drop all items you should do it a bit diffrent from this imo ...

Link to comment
Share on other sites

  • 0

Well my idea was just to drop weapons, as it is supposed to be a surrender script once you have been ambushed (of course for a role playing server).

 

What I try to do is have more interaction between the players (kidnapping, robbery, etc...), and less Kill on Sight. So the thing is how would a player drop all his weapons in such situation?

 

I thought about an addAction command, because seems fast and simple, but if it cant be done with Epoch, then is there a way to do it, key or what ever?

 

 

@DirtySanchez sorry, as you have already noticed, I m a bit new to scripting world, but I dont know what is a Donkey Menu GUI, or how can it be used with a hotkey, can you be a little more specific.

 

Thanks a lot for both replies

Link to comment
Share on other sites

  • 0

HAHA, no problem man.

Well both addaction and hotkeys can be used in EPOCH, there are plenty of scripts using them in the scripting forum, which is also the place to find my preview of the donkey menu before release.

I am already redoing the GUI on the main menu to add in a few more things and spruce it up a bit, plus going to make one for admins and donators.

Here is the link to the donkey menu so you can see what I am talking about.

I will take a look at some animations to add to the sequence to make it more realistic for the players!

HAHA, if forgot I already use this animation for my suicide on the menu...

Just add this puppy

player playAction "Surrender";
I will be looking into something a little better for the surrender action in just a few
Link to comment
Share on other sites

  • 0

Add this to Init.sqf

dpSurrender=(findDisplay 46) displayAddEventHandler ["keyDown", "if ((_this select 1) == 15) then {;null = [player] execvm 'surrender.sqf'}"];
Add this to surrender.sqf

 SurrenderEpoch = true;

	 _deadmanwalking = _this select 0;
	 _deadmanwalking action ["DropWeapon", "GroundWeaponHolder" createVehicle position player, currentWeapon _deadmanwalking];
	 //_deadmanwalking action ["DropWeapon", "GroundWeaponHolder" createVehicle position player, handgunWeapon _deadmanwalking];
	 //_deadmanwalking action ["DropWeapon", "GroundWeaponHolder" createVehicle position player, primaryWeapon _deadmanwalking];
	 _deadmanwalking playaction "surrender";
	 //_deadmanwalking playMove "amovpercmstpsnonwnondnon_amovpercmstpssurwnondnon"; //Animation in
	 (finddisplay 46) displayremoveeventhandler ["KeyDown",dpSurrender]; 
	 dpSurrender=(findDisplay 46) displayAddEventHandler ["keyDown", "if ((_this select 1) == 15) then {SurrenderEpoch=false}"];

	 while {SurrenderEpoch} do {
	 sleep 0.01;
	 _deadmanwalking playaction "surrender";
	 //player playMoveNow "AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon"; //Animation out
	 };

        dpSurrender=(findDisplay 46) displayAddEventHandler ["keyDown", "if ((_this select 1) == 15) then {;null = [player] execvm 'surrender.sqf'}"];
The commented areas in surrender.sqf are the different types of drop weapon actions built into ARMA

as well as a full animation for surrender but I haven't tested any of this at this point, but will be testing this in my menu this evening.

Hope this helps man, there was a bunch of info out there for this Search is your friend my man!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...