From be0c99e1ba064ca3b14b40e56f4f3458dd7e1577 Mon Sep 17 00:00:00 2001 From: McDiod Date: Thu, 13 Dec 2018 20:25:12 +0100 Subject: [PATCH] fix ending ceremony --- cfgParams.hpp | 20 ++++++++++---------- functions/events/fn_endMissionServer.sqf | 5 ++++- functions/events/fn_onUnitKilledServer.sqf | 4 ++-- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/cfgParams.hpp b/cfgParams.hpp index 54f10ae..81543a0 100644 --- a/cfgParams.hpp +++ b/cfgParams.hpp @@ -15,9 +15,16 @@ class Params { class KillsForWin { title = "Kills Needed To Win (Per Team)"; - values[] = {10,20,30,40,50,60}; - texts[] = {"10","20","30","40","50","60"}; - default = 20; + values[] = {1,3,5,10,15,20,30,40,50,60}; + texts[] = {"1","3","5","10","15","20","30","40","50","60"}; + default = 15; + }; + + class RespawnTime { + title = "Respawn Time (Seconds)"; + values[] = {5,10,20,30,40,50,60,70,80,90,100,110,120}; + texts[] = {"5","10","20","30","40","50","60","70","80","90","100","110","120"}; + default = 10; }; class GameMode { @@ -47,11 +54,4 @@ class Params { texts[] = {"1","2","3","4","5"}; default = 1; }; - - class RespawnTime { - title = "Respawn Time (Seconds)"; - values[] = {5,10,20,30,40,50,60,70,80,90,100,110,120}; - texts[] = {"5","10","20","30","40","50","60","70","80","90","100","110","120"}; - default = 10; - }; }; diff --git a/functions/events/fn_endMissionServer.sqf b/functions/events/fn_endMissionServer.sqf index a0b9b85..fde70f5 100644 --- a/functions/events/fn_endMissionServer.sqf +++ b/functions/events/fn_endMissionServer.sqf @@ -5,12 +5,15 @@ if (!isServer) exitWith {}; params [["_winnerTeamNamespace",objNull]]; missionNamespace setVariable [QGVAR(gameEnded),true,true]; +[[],{removeAllWeapons player}] remoteExecCall ["call",0,false]; _this spawn { params [["_winnerTeamNamespace",objNull]]; + sleep 1; + _centerPos = ([EGVAR(missionSetup,playAreaCenter),[0,50]] call EFUNC(common,randomPos)) findEmptyPosition [0,30,"B_Soldier_F"]; - if ((count _centerPos) > 0) then {_centerPos = EGVAR(missionSetup,playAreaCenter)}; + if ((count _centerPos) == 0) then {_centerPos = EGVAR(missionSetup,playAreaCenter)}; [nil,_centerPos] remoteExec [QEFUNC(common,teleport),0,false]; [_centerPos] remoteExec [QFUNC(respawnPlayer),0,false]; diff --git a/functions/events/fn_onUnitKilledServer.sqf b/functions/events/fn_onUnitKilledServer.sqf index fa8b4e3..d44c9d8 100644 --- a/functions/events/fn_onUnitKilledServer.sqf +++ b/functions/events/fn_onUnitKilledServer.sqf @@ -24,6 +24,8 @@ private _teamNamespace = _shooter getVariable [QEGVAR(missionSetup,teamNamespace private _newScore = (_teamNamespace getVariable [QEGVAR(missionSetup,currentScore),0]) + 1; _teamNamespace setVariable [QEGVAR(missionSetup,currentScore),_newScore, true]; +[_teamNamespace] call FUNC(updateRanking); + if (_newScore >= ("KillsForWin" call BIS_fnc_getParamValue)) exitWith { [_teamNamespace] call FUNC(endMissionServer); }; @@ -31,5 +33,3 @@ if (_newScore >= ("KillsForWin" call BIS_fnc_getParamValue)) exitWith { { [_x,_newScore] remoteExec [QFUNC(onIncreasedScore),_x,false]; } forEach (units group _shooter); - -[_teamNamespace] call FUNC(updateRanking);