That is interesting, I'm developing an MP mission loosely based on BF2 Project Reality Insurgency mode that sounds a lot like that too (the Insurgents can take weapons from the caches that the US are trying to destroy)! Fortunately, I'm moving in a quite different direction (not going to use shops, for example), so I don't think we will end up with anything at all similar ;P The more the merrier!
This should get you started:
_unit addEventHandler ["killed",
{
_victim = _this select 0;
_killer = _this select 1;
// Don't give bounty to player killers or after someone dies without a specific killer (e.g. fallen or run over)
if ((not (isNull _killer)) and ((side _killer) != (side _victim))) then
{
giveBountyTo = _killer;
publicVariable "giveBountyTo";
_bounty = rating _victim;
["payBountyEvent", [_bounty]] call SPON_publishGlobalEvent;
};
}
]
["payBountyEvent",
{
_bounty = _this select 0;
if (player == giveBountyTo) then
{
SPON_playerBankBalance = SPON_playerBankBalance + _bounty;
};
}
] call SPON_addEventHandler;
also, simple question, you mention scripts that need to run on the server.. as an editor how do i tell the script that it only runs on the server.
I'm sorry, but if you don't know this yet, you haven't scripted for
any MP missions yet and perhaps don't have much SP editing experience either (you might be an expert in SP, but just never noticed this command, but that is less likely). I'd seriously advise you, and most of the other people who've suggested similar projects to me for that matter,
not to start by trying to make a competetor to the most complex MP missions, such as Evo, Sahraniville or Sahrani Life. Starting with MP PVP is also even more complex than MP COOP! The phrase "walk before you can run" comes to mind...
OK, that is maybe harsh, but whether you want to continue on the super-complex mission path or start on a more sensible scale, the answer is:
// Do stuff on all machines up to this point.
if (not isServer) exitWith {}
// Do stuff only on the server after this point.
EDIT: Changed script to using the
rating command (I'd previously incorrectly used the
rank command)
EDIT: Oops; based the code on some I copy and pasted. Have changed to putting the the money into the bank account, not player's cash.