What you are trying to do is similar to any scoring system in MP, for which there are many examples in the forums. There are also many examples of respawn scripts. I am presuming this is a COOP mission where east side kills zombies.
Since enemy zombie units are AI and belong to the server, the "KILLED" eventhandler will fire on the server.
This is your zomres1.sqs
; *****************************************************
; ** Operation Flashpoint Script File
; *****************************************************
#zomres
"z_1" createUnit [getMarkerPos "zomres1", groupzom]
this AddEventHandler ["killed",{_this exec "enemykill.sqs"}]
~15
goto "zomres"
exit
Issues:
1) in MP want createUnit command run on server only. Add a game logic to your mission and name it server. Then add if not (local server) then {exit} to the top of scripts to be run on server only.
2) you are adding a zombie to group groupzom every 15 seconds. You will soon have more than the 12 units per group allowed. Count number of living members in group and respawn if less than 12.
So instead try:
zombspawn.sqs
; *****************************************************
; ** Operation Flashpoint Script File
; *****************************************************
if not(local server) then {exit}
_grp = _this select 0
_pos = _this select 1
;I've never used zombie addon so just add all types of zombies to array below
_z_types = ["z_1","z_2","z_3",...]
_nz_types = count _z_types
#loop
~2
if (({alive _x} count units _grp) == 12) then {goto "loop"}
#spawnloop
_z_n = random _nz_types
_z_n = _z_n - (_z_n % 1)
(_z_types select _z_n) createUnit [_pos, _grp,{this addEventHandler ["killed",{_this exec "enemykill.sqs"}]},0.5,"PRIVATE"]
~1
if (({alive _x} count units _grp) < 12) then {goto "spawnloop"}
goto "loop"
exit
Now you just have to add one zombie leader for each zombie group you want and put the following in its init field:
[group this, getMarkerPos "zomres1"] exec "zombspawn.sqs"
Make sure you have added a game logic named server to the mission.
Now for enemykill.sqs
_moneyernt=25
playercounter=playercounter+_moneyernt
exit
The thing to keep in mind in MP is that each player can have a different value for playercounter, so the group pool must be communicated via the publicVariable command. playercounter will be the pooled funds.
enemykill.sqs
_moneyernt=25
playercounter = playercounter + _moneyernt
publicVariable "playercounter"
exit
There are other issues in MP. With the addAction command, the action happens only on the machine of the player who did the action, so your removeAction command will only remove the action on the one players machine. Also, all hints will only display on one player's machine.
The best model for MP is to define a bunch of flags, and then use triggers and publicVariable to make sure everything works okay. Here is an example. In your init.sqs
ss_displayfunds = FALSE
Then put a trigger on your map with condition ss_displayfunds. In activation put
hint format ["%1 pounds remaining",playercounter]; ss_displayfunds = FALSE
Then anywhere in any of your scripts when you want all players to see remaining funds insert the following:
ss_displayfunds = TRUE
publicVariable "ss_displayfunds"
A similar system should be used for adding/removing actions and positioning the sandbags to make sure all players see the same thing. Here is another example. In your init.sqs
ss_sand1 = FALSE
Then put a trigger on your map with condition ss_sand1. In activation put
[] exec "buysand1.sqs"; ss_sand1 = FALSE
And in your mission itself the init for defhq:
sandbg1=defhq addaction ["Level 1 Sandbags [£250]","buysand1_cmd.sqs"]
Then you also need this script buysand1_cmd.sqs
ss_sand1 = TRUE
publicVariable "ss_sand1"
Now the flag variable ss_sand1 will be set to true on all machines, and the trigger will run the script buysand1.sqs on all machines. This guarantees that for all players: the group funds are the same, the hints are displayed, the buy sandbag type 1 action is removed, and the sandbags are repositioned.l