diff --git a/scripts/RotorOpsPerks.lua b/scripts/RotorOpsPerks.lua index 1dde328..5794766 100644 --- a/scripts/RotorOpsPerks.lua +++ b/scripts/RotorOpsPerks.lua @@ -15,7 +15,7 @@ RotorOpsPerks = {} -RotorOpsPerks.version = "1.5.2" +RotorOpsPerks.version = "1.5.3" env.warning('ROTOROPS PERKS STARTED: '..RotorOpsPerks.version) trigger.action.outText('ROTOROPS PERKS STARTED: '..RotorOpsPerks.version, 10) RotorOpsPerks.perks = {} @@ -31,7 +31,7 @@ RotorOpsPerks.player_update_messages = true --set to false to disable messages w RotorOpsPerks.debug = false RotorOpsPerks.points = { - player_default=1000, --how many points each player will start with + player_default=0, --how many points each player will start with kill=10, kill_inf=5, kill_heli=20, diff --git a/scripts/RotorOpsServer.lua b/scripts/RotorOpsServer.lua index 209c9bb..ff7a994 100644 --- a/scripts/RotorOpsServer.lua +++ b/scripts/RotorOpsServer.lua @@ -28,46 +28,50 @@ function RotorOpsServer.endMission(secs) countdown() end -function RotorOpsServer.convertPointsToSpawnCredits(playerName, points) - if dcsbot then - env.info("RotorOpsServer: Converting "..points.." points to spawn credits for "..playerName) - dcsbot.addUserPoints(playerName, points) - return true - end - return false -end -function RotorOpsServer.addPerks() - env.info("RotorOpsServer: Adding perks to RotorOpsPerks.") - ---- PERKS: Convert points to spawn credits ---- +--The following code for integrating the server bot spawn credits with PERKS works fine, but it needs to +-- be moved to a server script so it's not dependent on this mission script. - RotorOpsPerks.perks["spawnCredits"] = { - perk_name='spawnCredits', - display_name='Buy 10 Spawn Credits', - cost=50, - cooldown=0, - max_per_player=1000, - max_per_mission=1000, - at_mark=false, - at_position=true, - enabled=true, - sides={0,1,2}, - } - - RotorOpsPerks.perks.spawnCredits["action_function"] = function(args) - local playerName = Unit.getByName(args.player_unit_name):getPlayerName() - return RotorOpsServer.convertPointsToSpawnCredits(playerName, 10) - end - - ---- End of Spawn Credits Perk ---- - -end - -if dcsbot then - RotorOpsServer.addPerks() -else - env.warning("RotorOpsServer: DCSBot not found. Perks not added.") -end +-- function RotorOpsServer.convertPointsToSpawnCredits(playerName, points) +-- if dcsbot then +-- env.info("RotorOpsServer: Converting "..points.." points to spawn credits for "..playerName) +-- dcsbot.addUserPoints(playerName, points) +-- return true +-- end +-- return false +-- end +-- +-- function RotorOpsServer.addPerks() +-- env.info("RotorOpsServer: Adding perks to RotorOpsPerks.") +-- ---- PERKS: Convert points to spawn credits ---- +-- +-- RotorOpsPerks.perks["spawnCredits"] = { +-- perk_name='spawnCredits', +-- display_name='Buy 100 Spawn Slot Credits', +-- cost=100, +-- cooldown=0, +-- max_per_player=1000000, +-- max_per_mission=1000000, +-- at_mark=false, +-- at_position=true, +-- enabled=true, +-- sides={0,1,2}, +-- } +-- +-- RotorOpsPerks.perks.spawnCredits["action_function"] = function(args) +-- local playerName = Unit.getByName(args.player_unit_name):getPlayerName() +-- return RotorOpsServer.convertPointsToSpawnCredits(playerName, 100) +-- end +-- +-- ---- End of Spawn Credits Perk ---- +-- +-- end +-- +-- if dcsbot then +-- RotorOpsServer.addPerks() +-- else +-- env.warning("RotorOpsServer: DCSBot not found. Perks not added.") +-- end