omskTransmash Posted January 29, 2022 Posted January 29, 2022 For example in Hoggit Syran 3.0 server, if player loads more weapons than he is allowed, soon the player cannot control the aircraft and it crashes. How can I do that in my server? it says Object.Destroy() doesn't work on player client slot, and slmod only has "Kick" command, (I never used slmod before though) I have some experience in programming so just point me to the right direction and I can do it from there. Any help would be appreciated. Thank you!
cfrag Posted January 29, 2022 Posted January 29, 2022 It rather depends on what you are trying to achieve. If you want to outright destroy a client plane, that can only be achieved on the server side, using a script in /Hooks - you would kick the player, which you usually signal with a flag (since server and mission can only communicate with flags - rather oldschool, but secure) If you simply want to punish the player for trying to cheat, and remove their plane by sheer physics, you already described a work-around that apparently (I did not look at the code, this is me just guessing) the mission you referenced uses: it overloads the plane most likely by invoking (the fiendishly difficult to find, since it's not in the unit tree) trigger.action.setUnitInternalCargo() with a deadly weight. That way the plane crashes or can't even depart, and you don't have to tell the server to do the dirty work (plus, it also works in single player)
Wizxrd Posted January 29, 2022 Posted January 29, 2022 You can use the explosion function which will drop an explosion on a specific point combined with the kg equivalent for TNT. You can find it here: https://wiki.hoggitworld.com/view/DCS_func_explosion
cfrag Posted January 29, 2022 Posted January 29, 2022 (edited) 27 minutes ago, Wizxrd said: You can use the explosion function which will drop an explosion on a specific point combined with the kg equivalent for TNT. You can find it here: https://wiki.hoggitworld.com/view/DCS_func_explosion That's a great idea - but doesn't that risk damaging nearby units as well? Edited January 29, 2022 by cfrag
Wizxrd Posted January 29, 2022 Posted January 29, 2022 (edited) 1 hour ago, cfrag said: That's a great idea - but doesn't that risk damaging nearby units as well? As long as the power is 1 I don’t think that should be any worry, that is unless someone is obviously right next to them which there might be some… splash damage lol Edited January 29, 2022 by Wizxrd
Recommended Posts