piXel496 Posted November 26, 2015 Posted November 26, 2015 (edited) Dear server admins, When hopping free flight servers I noticed the new hip is shooting at other players. It is nice to see that the DCS online community is growing, but the infantile need some guidance as long as slmod does not work. Maybe a simple (do script) trigger in the mission could help for the time being: noGunsEvHandler = {} function noGunsEvHandler:onEvent(_shooting) if _shooting.id == world.event.S_EVENT_SHOOTING_START then local _offender = _shooting.initiator sanction(_offender) end end world.addEventHandler(noGunsEvHandler) function sanction(_shootingPlayer) local _plrName = _shootingPlayer:getPlayerName() trigger.action.explosion(_shootingPlayer:getPoint(), 1) --trigger.action.outText(_plrName .." do NOT shoot! Thank you..", 1) --uncomment if you want a message end Thx for hosting. Example mission attached.noGunsExample_V2.miz Edited November 27, 2015 by piXel496 had to adjust script "getID" is bugged in MP 4 old stuff I made
sFalcon Posted November 26, 2015 Posted November 26, 2015 (edited) Hi PiXel, Thank you for this script! It works pretty good! Also, is there a way to kick a shooting player out of their aircraft, instead of damaging their aircraft? Going to add this to the server anyway sFalcon. DCS Aerobatic & FreeFlight Edited November 26, 2015 by sFalcon 1 [sIGPIC][/sIGPIC] _______ sFalcon.
piXel496 Posted November 26, 2015 Author Posted November 26, 2015 Hi sFalcon, To kick a shooting player back to the lobby would be: _shootingPlayer:destroy(). That was my prefered method to cleanly remove an offender but the function ":destroy()" is broken. And I don't know how to "script-force" eject a player. . old stuff I made
sFalcon Posted November 26, 2015 Posted November 26, 2015 _shootingPlayer:destroy() seems to destroy the plane only. I've also read somewhere that it was possible to script remove all ammo upon fire.. [sIGPIC][/sIGPIC] _______ sFalcon.
RazorbackNL Posted November 26, 2015 Posted November 26, 2015 How can I implement this script in my mission? I am not so good with scripts. Asus ROG Crosshair VIII Hero (Wi-Fi) | AMD Ryzen 9 5900X @ 4,5Ghz | 128Gb DDR4 3200Mhz | beQuiet! Dark Power 12 1200W | 2 x 2Tb M.2 Samsung SSD | 2 x 4Tb M.2 Samsung SSD | Aorus RTX3090 Xtreme 24Gb | Windows 10 Pro x64 | HOTAS Cougar (heavily modified) | MFG Crosswind pedals | CH Throttle Quadrant | TrackIR5 | Oculus Quest 2 | VoiceAttack Aviate Navigate Communicate
piXel496 Posted November 26, 2015 Author Posted November 26, 2015 (edited) @ sFalcon _shootingPlayer:destroy() currently crashes DCS on my side. If it worked as suppost the plane is removed silently and the player becomes a spectater in the lobby. @Razorback[NL] howTo in 4 steps: Then you have created a trigger that is fired once at the first second of the mission and runs the script. From then on the script-snipped takes over and acts everytime when someone pulls the trigger of there canon. . Edited November 26, 2015 by piXel496 lekker nederlands onderonsje.. old stuff I made
Shahdoh Posted November 26, 2015 Posted November 26, 2015 We had scripts like this on the VA server, but when I last tested it, it only worked for the server, not any of the clients. Has this been confirmed working on a client connection?
piXel496 Posted November 27, 2015 Author Posted November 27, 2015 (edited) good question...:wassat: Technically it should but scripting has become a slippery place, so I can't tell for sure. I am startingup and update DCS on my second computer now. . Edited November 27, 2015 by piXel496 old stuff I made
Shahdoh Posted November 27, 2015 Posted November 27, 2015 Running some new tests myself atm. Fingers crossed.
Shahdoh Posted November 27, 2015 Posted November 27, 2015 Nope, same issue still, scripts work for the server only, not client connections. B(
piXel496 Posted November 27, 2015 Author Posted November 27, 2015 (edited) ok, getID does not work in MP. But with a small workaround the script now works. Also on client side in MP. I realy hope scripting gets some debug attention in the near future from the DCS magicians. Anyway first post updated and it works. . Edited November 27, 2015 by piXel496 old stuff I made
iFoxRomeo Posted November 29, 2015 Posted November 29, 2015 Dear server admins, When hopping free flight servers I noticed the new hip is shooting at other players. It is nice to see that the DCS online community is growing, but the infantile need some guidance as long as slmod does not work. Maybe a simple (do script) trigger in the mission could help for the time being: noGunsEvHandler = {} function noGunsEvHandler:onEvent(_shooting) if _shooting.id == world.event.S_EVENT_SHOOTING_START then local _offender = _shooting.initiator sanction(_offender) end end world.addEventHandler(noGunsEvHandler) function sanction(_shootingPlayer) local _plrName = _shootingPlayer:getPlayerName() trigger.action.explosion(_shootingPlayer:getPoint(), 1) --trigger.action.outText(_plrName .." do NOT shoot! Thank you..", 1) --uncomment if you want a message end Thx for hosting. Example mission attached. Why isn´t that added to dcs as a trigger by ED?? Thank you for that, but is it possible to have the no weapons script to be active only in a triggerzone? E.g. a placed triggerzone around a certain airfield to prevent shooting at departing aircraft, but allow shooting away from the airfield? Or the other way around, only allow shooting within a trigger area, but not outside of it? Fox Spoiler PC Specs: Ryzen 9 5900X, 3080ti, 64GB RAM, Oculus Quest 3
Recommended Posts