Jump to content

Aerobatic servers and shooting players..


Recommended Posts

Posted (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 by piXel496
had to adjust script "getID" is bugged in MP
  • Like 4
Posted (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 by sFalcon
  • Like 1



[sIGPIC][/sIGPIC]

_______


sFalcon.

Posted

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.

 

 

 

 

 

 

 

.

Posted

_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.

Posted

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

Posted (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:

attachment.php?attachmentid=128476&d=1448581495

 

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.

 

 

 

 

 

 

 

.

create-trigger.thumb.jpg.cff3cdb01749c60a362d9bfd22b32238.jpg

Edited by piXel496
lekker nederlands onderonsje..
Posted

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?

Posted (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 by piXel496
Posted (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 by piXel496
Posted
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...