bumyplum 10 Posted February 22, 2019 Is there away that anyone knows that will prevent the player from being able to throw grenades for a certain time period? Share this post Link to post Share on other sites
FallujahMedic -FM- 866 Posted February 23, 2019 context? There is a "weapons safe" script out there. Share this post Link to post Share on other sites
bumyplum 10 Posted February 23, 2019 Just now, FallujahMedic -FM- said: context? There is a "weapons safe" script out there. Idm the ability to fire just don't want people to throw grenades for a certain time period at the start of a mission Share this post Link to post Share on other sites
FallujahMedic -FM- 866 Posted February 23, 2019 http://ferstaberinde.com/f3/en//index.php?title=Main_Page Look for "safe start" http://ferstaberinde.com/f3/en//index.php?title=Safe_Start Share this post Link to post Share on other sites
HazJ 1288 Posted February 23, 2019 Search is your friend. http://www.armaholic.com/page.php?id=18751 One of the first original ones. Back in the day when everyone learnt that G is for grenade. Or create your own... Simple Fired/Throw EH, depends on if you want to prevent just grenades. Though you can filter Fired EH anyway. https://community.bistudio.com/wiki/Arma_3:_Event_Handlers Share this post Link to post Share on other sites
bumyplum 10 Posted February 23, 2019 38 minutes ago, HazJ said: Search is your friend. http://www.armaholic.com/page.php?id=18751 One of the first original ones. Back in the day when everyone learnt that G is for grenade. Or create your own... Simple Fired/Throw EH, depends on if you want to prevent just grenades. Though you can filter Fired EH anyway. https://community.bistudio.com/wiki/Arma_3:_Event_Handlers How would I add the grenade you just threw back to your inventory, I've tried; throw1 = currentThrowable player; player additem throw1; however, currentThrowable returns, ["SmokeShellBlue","SmokeShellBlueMuzzle",[1.00693e+00]] which makes it not able to add the item, how would i get the purely just the class name of current throwable? Share this post Link to post Share on other sites
HazJ 1288 Posted February 23, 2019 player addEventHandler ["FiredMan", { params ["_unit", "_firer", "_distance", "_weapon", "_muzzle", "_mode", "_ammo", "_gunner"]; if ( ([_mode] call BIS_fnc_itemType select 1) isEqualTo "Grenade" ) exitWith { hintSilent "You are not authorised to throw grenades yet."; deleteVehicle _ammo; _unit addMagazine _mode; }; }]; Add the above to initPlayerLocal.sqf in mission root, create one if doesn't exist. Quickly done. Can't override this EH. Might be a better way to do it. Using inGameUISetEventHandler to prevent actual grenade being thrown but a bit busy right now. May update this thread later with alternative solution. Share this post Link to post Share on other sites
bumyplum 10 Posted February 23, 2019 12 minutes ago, HazJ said: player addEventHandler ["FiredMan", { params ["_unit", "_firer", "_distance", "_weapon", "_muzzle", "_mode", "_ammo", "_gunner"]; if ( ([_mode] call BIS_fnc_itemType select 1) isEqualTo "Grenade" ) exitWith { hintSilent "You are not authorised to throw grenades yet."; deleteVehicle _ammo; _unit addMagazine _mode; }; }]; Quickly done. Can't override this EH. Might be a better way to do it. Using inGameUISetEventHandler to prevent actual grenade being thrown but a bit busy right now. May update this threat later with alternative solution. Even if i don't use it it still would be useful to know how to get the base class name of a players currentthrowable, and thanks for the help. 🙂 Share this post Link to post Share on other sites
HazJ 1288 Posted February 23, 2019 Read the Wiki. https://community.bistudio.com/wiki/currentThrowable To get the classname, it'll be: select 0 currentThrowable player select 0 Share this post Link to post Share on other sites