Jump to content
Sign in to follow this  
lee1hy

disable weapon in respwan_west

Recommended Posts

I found this script,

this is disable weapons in trigger zone and it disable greande/NLAW but not a rifle ammo!!!!!!!

bullet is fired what is the problem to try to stop a bullet??

private ["_gunner", "_ammotype", "_bullet", "_gunobject"];

_gunner = _this select 0;
_ammotype = _this select 4; 

if (_gunner in list triggersafezone)
then 
{
_bullet = position _gunner nearObjects [_ammotype,20];
_gunobject = _bullet select 0;
_gunobject setPos [2196.4,3488.98,0];
hint "Removed";
}
else
{
hint "Not Removed";
};

Share this post


Link to post
Share on other sites

{player removemagazines _x} foreach magazines player;

Use this instead of that overly complicated script. I see no reason to try to take a bullet and remove it but leaving the player with loaded magazines.

Share this post


Link to post
Share on other sites

Removing magazines is a very unclean solution. Especially if you dont save and readd the magazines afterwards.

Try this instead:

if (!isPlayer) exitWith {};

private["_triggers","_list"];

_triggers = [triggersafezone,anothersafezonetrigger];

while(true) do {
 _list = [];
 {_list = _list + (list _x)} forEach _triggers;

 if (player in _list) then {
   player action ["WEAPONONBACK", player];
 } else {
   player action ["WEAPONINHAND", player];
 }
 sleep 0.5;
};

Save that as a script-file "safezone.sqf" and put the following in your "init.sqf".

nul = [] execVM "safezone.sqf";

I havent tested the "weapononback" in the Alpha yet, but it should work.

Share this post


Link to post
Share on other sites

player addEventHandler ["Respawn", {
{player removemagazines _x} foreach magazines player;
deletevehicle (_this select 1);
}];

Put this in the init.sqf.

Tajin, how exactly is removing magazines an unclean solution if he doesn't want the player to fire his weapon?

ACTUALLY WHAT THE HECK, I can't read. Don't use the above, didn't see it was for a special trigger zone. respawn_west got me thinking about respawn..

Share this post


Link to post
Share on other sites

If you remove magazines, players have to go and get new ones all the time. That would be rather inconvenient, don't you think?

Share this post


Link to post
Share on other sites

thanks!! both but still can fire rifle!!!!!!

no need eventhandler?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×