Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
McDiod committed Aug 15, 2016
1 parent 8dba787 commit 9193b96
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 8 deletions.
2 changes: 1 addition & 1 deletion description.ext
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ respawnTemplates[] = {"Base"};
respawnOnStart = -1;
respawnDialog = 0;
disabledAI = 1;
enableDebugConsole = 2;
enableDebugConsole = 1;

//PARAMS =======================================================================
class Params {
Expand Down
8 changes: 8 additions & 0 deletions functions/fn_endingCeremony.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ GAMEENDED = true;

//respawn player instantly if dead
if (!alive player) then {
_camera = player getVariable "killCam";
if (!isNil "_camera") then {
_killCamHandle = (player getVariable ["killCamHandle", [scriptNull]]) select 0;
terminate _killCamHandle;
camDestroy _camera;
showCinemaBorder false;
};

iJustSpawned = true;
setPlayerRespawnTime 0;
forceRespawn player;
Expand Down
11 changes: 5 additions & 6 deletions leaderboard/fn_showLeaderboard.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ _distanceMoved = round (player getVariable ["totalDistance", 0]);
//DISPLAY LEADERBOARD ==========================================================
//fill one row function
_fillRow = {
params ["_display","_startID","_playerArray"];
params ["_display","_startID","_playerArray", "_rank"];
_statsArray = _playerArray select 3;

_rank = _playerArray select 0;
(_display displayCtrl _startID) ctrlSetText (str _rank);

_name = _playerArray select 2;
Expand All @@ -53,19 +52,19 @@ _fillRow = {
_playerUnit = [_playerArray select 1] call BIS_fnc_getUnitByUID;
_playerPointsGained = _playerUnit getVariable ["eloThisGame", 0];
_points = round (_playerArray select 0);
_sign = if (_playerPointsGained < 0) then {"-"} else {"+"};
_sign = if (_playerPointsGained < 0) then {""} else {"+"};
_pointsText = format ["%1 (%2%3)", _points, _sign, _playerPointsGained];
(_display displayCtrl (_startID+4)) ctrlSetText _pointsText;
};

//fill first 4 rows
for [{_i=0}, {_i< count _gogStats}, {_i=_i+1}] do {
[_display, lb_0_0 + (_i*100), _gogStats select _i] call _fillRow;
for [{_i=0}, {_i< ((count _gogStats) min 4)}, {_i=_i+1}] do {
[_display, lb_0_0 + (_i*100), _gogStats select _i, _i+1] call _fillRow;
};

//fill row 5
if (count _gogStats > 4) then {
_playerID = [_gogStats, getPlayerUID player, 1] call mcd_fnc_findStringInArray;
_rowFiveID = if (_playerID < 4) then {4} else {_playerID};
[_display, lb_4_0, _gogStats select _rowFiveID] call _fillRow;
[_display, lb_4_0, _gogStats select _rowFiveID, _rowFiveID + 1] call _fillRow;
};
12 changes: 11 additions & 1 deletion onPlayerKilled.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ _shooter = player getVariable ["ACE_medical_lastDamageSource",player];
[getPos player, profileName] remoteExec ["mcd_fnc_weaponCleanup", 2, false];

//create kill cam
[(SOLORESPAWNTIME min TEAMRESPAWNTIME) min 10] execVM "player\killCam.sqf";
_killCamHandle = [(SOLORESPAWNTIME min TEAMRESPAWNTIME) min 10] execVM "player\killCam.sqf";
player setVariable ["killCamHandle", [_killCamHandle]];

//keep player from respawning
setPlayerRespawnTime 9999;
Expand Down Expand Up @@ -91,6 +92,15 @@ if (GAMEENDED) exitWith {};
_respawning = parseText format ["<t align='center' color='#00ff00' size='1.4'>Respawning...</t>"];
hint composeText [_rule, _respawning, _lineBreak, _rule];

//destroy killcam
_camera = player getVariable "killCam";
if (!isNil "_camera") then {
_killCamHandle = (player getVariable ["killCamHandle", [scriptNull]]) select 0;
terminate _killCamHandle;
camDestroy _camera;
showCinemaBorder false;
};

//respawn player
iJustSpawned = true;
setPlayerRespawnTime 0;
Expand Down
1 change: 1 addition & 0 deletions player/killCam.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ _title = _display displayCtrl KILLCAMTITLE_TITLE;
_title ctrlSetText _killMessage;

_camera = "camera" camCreate ((getPos _unit) vectorAdd [0,0,2]);
player setVariable ["killCam", _camera];
_camera cameraEffect ["internal","back"];

showCinemaBorder true;
Expand Down

0 comments on commit 9193b96

Please sign in to comment.