Skip to content

Commit

Permalink
fix ending ceremony
Browse files Browse the repository at this point in the history
  • Loading branch information
McDiod committed Dec 13, 2018
1 parent a0bfd8e commit be0c99e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
20 changes: 10 additions & 10 deletions cfgParams.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
};
};
5 changes: 4 additions & 1 deletion functions/events/fn_endMissionServer.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
4 changes: 2 additions & 2 deletions functions/events/fn_onUnitKilledServer.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ 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);
};

{
[_x,_newScore] remoteExec [QFUNC(onIncreasedScore),_x,false];
} forEach (units group _shooter);

[_teamNamespace] call FUNC(updateRanking);

0 comments on commit be0c99e

Please sign in to comment.