shuko 59 Posted March 28, 2011 (edited) fuck it Edited February 7, 2012 by Shuko Share this post Link to post Share on other sites
sickboy 13 Posted March 28, 2011 (edited) You can also simply replace addEventHandler ["killed" with addMPEventHandler ["MPKilled" which is triggered globally, so you can attach them just on the server. Perhaps not the best example? Also captive units are registered with side == civilian too. Using side (group _x) would always return the proper side. Edited March 28, 2011 by Sickboy Share this post Link to post Share on other sites
.kju 3245 Posted March 28, 2011 init.sqf // Global variable to hold the death counter. DeadCivilians = 0; This is not JIP safe. PV variables will be automatically synced for JIP, yet you overwrite it locally again here as the init.sqf is processed after the JIP data is received. Instead you need: if (isNil "DeadCivilians") then {DeadCivilians = 0;}; The topic name should be clarified too, like "Example of ...". Share this post Link to post Share on other sites
shuko 59 Posted March 28, 2011 This is not JIP safe. PV variables will be automatically synced for JIP, yet you overwrite it locally again here as the init.sqf is processed after the JIP data is received. Doesn't matter since it will be re-overwritten next time the server PVs the var. Display is tied to update. Share this post Link to post Share on other sites
sickboy 13 Posted March 28, 2011 Doesn't matter since it will be re-overwritten next time the server PVs the var. Display is tied to update.If you'd use the isNil method the display will be fine immediately upon joining, without having to wait for an update (happening upon killed EH only I think).I see you now removed the code - I wasn't saying it was crap - just that the used code to example the PV + PVEH, addEventHandler "Killed", perhaps wasn't the best to example this stuff in, because they can be easily done without using PV's. That just means i'd recommend to exhange the killed eventhandler bits with something else, not that the essence is crap ;) PV + PVEH definitely ftw ;) Share this post Link to post Share on other sites
shuko 59 Posted March 28, 2011 The kill counter was from an old thread. Still, it was a working example. I hoped the focus would have been more on the essence of it. Now it's replaced with a different example, feel free to rip it apart. ;) Share this post Link to post Share on other sites
twirly 11 Posted March 28, 2011 This is really helpfull guys...thanks a lot Shuko. Just got a fourth copy of Arma 2....two for me to test at home and two to give to my buddies to play online when I can figure the MP stuff out.... so this is great timing! Thanks again. Share this post Link to post Share on other sites
wobbleyheadedbob 10 Posted April 1, 2011 (edited) Thanks shuko! Would this approach work if I used it to create a function to 'addAction'/'removeAction' on dynamically created vehicles? Edited April 1, 2011 by Wobbleyheadedbob Share this post Link to post Share on other sites
wobbleyheadedbob 10 Posted April 2, 2011 Sweet, I started putting it together last night anyway. now just need to test with multiple clients. I think I may need to add another eventHandler on the server-side to listen for events triggered by the clients. Share this post Link to post Share on other sites
wobbleyheadedbob 10 Posted April 3, 2011 (edited) Thanks again Shuko, this has worked brilliantly. I've made Deployable MHQ's that players can "Sign-In" to and they will then be "Stationed" there meaning they will respawn there when killed. They can also pack them up again into a Mobile vehicle. Tested on the Dedi and Listen server and it's now JIP compatible. Edited April 3, 2011 by Wobbleyheadedbob Share this post Link to post Share on other sites