diff --git a/.vscode/settings.json b/.vscode/settings.json index 2ce79d3..3cb958d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -30,10 +30,18 @@ "KPR_tkPenalty", "KPR_updateInterval", "KPR_fnc_addActions", + "KPR_fnc_addScore", "KPR_fnc_applyRank", "KPR_fnc_autoLoop", "KPR_fnc_entityKilled", "KPR_fnc_getAceKiller", + "KPR_fnc_getInsigniaData", + "KPR_fnc_getPlayerIndex", + "KPR_fnc_getPlaytime", + "KPR_fnc_getPlaytimePlain", + "KPR_fnc_getUniformIndex", + "KPR_fnc_getRank", + "KPR_fnc_getScore", "KPR_fnc_initACE", "KPR_fnc_isAdmin", "KPR_fnc_openDialogPlayers", @@ -42,6 +50,7 @@ "KPR_fnc_savePlayers", "KPR_fnc_scoreUpdate", "KPR_fnc_setDefaultUniforms", + "KPR_fnc_setScore", "KPR_fnc_showHint", "KPR_fnc_uniformFill" ] diff --git a/README.md b/README.md index 7dc7e55..8693cf9 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,8 @@ Currently the mod is localized for: * English * German * Polish +* Portuguese +* Spanish ## Mods Required: @@ -65,8 +67,26 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. ## Changelog +### v2.0.2 +* Added: Portuguese localization. Thanks to [AngusDLX](https://github.com/AngusDLX) +* Added: Spanish localization. Thanks to [Jettfiremachine](https://github.com/amunoz20) +* Added: Some more functions which could become handy for mission creators: + * [KPR_fnc_getInsigniaData](https://github.com/KillahPotatoes/KP-Ranks/blob/master/addons/KP_Ranks/fnc/fn_getInsigniaData.sqf) + * [KPR_fnc_getRankName](https://github.com/KillahPotatoes/KP-Ranks/blob/master/addons/KP_Ranks/fnc/fn_getRankName.sqf) + * [KPR_fnc_getPlaytime](https://github.com/KillahPotatoes/KP-Ranks/blob/master/addons/KP_Ranks/fnc/fn_getPlaytime.sqf) + * [KPR_fnc_getPlaytimePlain](https://github.com/KillahPotatoes/KP-Ranks/blob/master/addons/KP_Ranks/fnc/fn_getPlaytimePlain.sqf) + * [KPR_fnc_getRankScore](https://github.com/KillahPotatoes/KP-Ranks/blob/master/addons/KP_Ranks/fnc/fn_getRankScore.sqf) + * [KPR_fnc_getRankScoreNext](https://github.com/KillahPotatoes/KP-Ranks/blob/master/addons/KP_Ranks/fnc/fn_getRankScoreNext.sqf) +* Added: Tooltip for deactivated rank setting in the player dialog, if the leveling system is enabled. +* Added: Playtime in the player name tooltip in the player management dialog. +* Added: [KP Ranks Wiki](https://github.com/KillahPotatoes/KP-Ranks/wiki) on GitHub with examples to use the functions. +* Tweaked: Undefined arguments for calls replaced with empty arrays as arguments. +* Tweaked: Usage of getter/setter functions in internal scripts. +* Fixed: Rank apply auto loop could be running in two instances. +* Fixed: Dialogs close directly if opened with "standard action" key. + ### v2.0.1 -* Added: Getter/Setter and helpful functions, so content/mission creators can easily access the KP Ranks data. +* Added: Getter/Setter and helpful functions, so content/mission creators can easily access the KP Ranks data: * [KPR_fnc_getRank](https://github.com/KillahPotatoes/KP-Ranks/blob/master/addons/KP_Ranks/fnc/fn_getRank.sqf) * [KPR_fnc_setRank](https://github.com/KillahPotatoes/KP-Ranks/blob/master/addons/KP_Ranks/fnc/fn_setRank.sqf) * [KPR_fnc_hasRank](https://github.com/KillahPotatoes/KP-Ranks/blob/master/addons/KP_Ranks/fnc/fn_hasRank.sqf) diff --git a/addons/KP_Ranks/KPR_dialogs.hpp b/addons/KP_Ranks/KPR_dialogs.hpp index 9e76231..526a5c3 100644 --- a/addons/KP_Ranks/KPR_dialogs.hpp +++ b/addons/KP_Ranks/KPR_dialogs.hpp @@ -26,8 +26,6 @@ class KPR_playerList { }; class controls { - class KPR_DialogCross: KP_DialogCross {}; - class KPR_ControlsGroup: KP_ControlsGroup { idc = 75801; x = KP_GETCX(KP_X_VAL,KP_WIDTH_VAL,0,1); @@ -103,6 +101,8 @@ class KPR_playerList { tooltip = "$STR_KPR_DIALOG_SAVEDESC"; onButtonClick = "call KPR_fnc_playerSave"; }; + + class KPR_DialogCross: KP_DialogCross {}; }; }; @@ -183,8 +183,6 @@ class KPR_uniformList { }; class controls { - class KPR_DialogCross: KP_DialogCross {}; - class KPR_ListActive: KP_Listbox { idc = 75801; x = KP_GETCX(KP_X_VAL,KP_WIDTH_VAL,0,1); @@ -250,5 +248,7 @@ class KPR_uniformList { tooltip = "$STR_KPR_DIALOG_EXPORTDESC"; onButtonClick = "call KPR_fnc_uniformExport"; }; + + class KPR_DialogCross: KP_DialogCross {}; }; }; diff --git a/addons/KP_Ranks/KP_uiDefines.hpp b/addons/KP_Ranks/KP_uiDefines.hpp index ba1d490..f3d9eb2 100644 --- a/addons/KP_Ranks/KP_uiDefines.hpp +++ b/addons/KP_Ranks/KP_uiDefines.hpp @@ -4,7 +4,7 @@ File: KP_uiDefines.hpp Author: Wyqer - https://github.com/KillahPotatoes Date: 2018-07-10 - Last Update: 2018-07-27 + Last Update: 2018-08-07 License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html Description: @@ -14,15 +14,19 @@ // BI class includes // Details via: "Default" call BIS_fnc_exportGUIBaseClasses; class ScrollBar; +class RscActivePicture; class RscActiveText; class RscButton; class RscCheckBox; class RscCombo; class RscControlsGroup; +class RscEdit; class RscListBox; +class RscListNBox; class RscShortcutButton; class RscText; class RscXListBox; +class RscXSliderH; /* --- General Defines --- @@ -138,6 +142,12 @@ class KP_Text: RscText { sizeEx = KP_TEXT_M; }; +// Inline Title +class KP_InlineTitle: RscText { + style = 2; + sizeEx = KP_TEXT_L; +}; + // Active Text class KP_ActiveText: RscActiveText { style = 2; @@ -149,6 +159,8 @@ class KP_Picture: RscText { style = 48; }; +class KP_ActivePicture: RscActivePicture {}; + // Picture which keeps aspect ratio class KP_PictureRatio: RscText { style = 48 + 2048; @@ -156,17 +168,21 @@ class KP_PictureRatio: RscText { // Button class KP_Button: RscButton { + colorBackground[] = KP_COLOR_BACKGROUND; + colorFocused[] = KP_COLOR_BACKGROUND; h = safeZoneH * KP_HEIGTH_BUTTON; sizeEx = KP_TEXT_M; }; -// Shortcut Button -class KP_ShortcutButton: RscShortcutButton { - colorBackground[] = {0.2, 0.2, 0.2, 1}; - colorBackgroundFocused[] = {0.25, 0.25, 0.25, 1}; - colorBackground2[] = {0.25, 0.25, 0.25, 1}; - style = 2; +// Inline Button +class KP_InlineButton: RscButton { + colorBackground[] = {0.25, 0.25, 0.25, 1}; + colorBackgroundDisabled[] = {0, 1, 0, 1}; + colorBackgroundActive[] = {0.3, 0.3, 0.3, 1}; + colorFocused[] = {0.25, 0.25, 0.25, 1}; sizeEx = KP_TEXT_M; + offsetPressedX = safeZoneW * 0.0005; + offsetPressedY = safeZoneH * 0.001; } // Controls group @@ -190,12 +206,28 @@ class KP_ListBox: RscListBox { sizeEx = KP_TEXT_M; }; +class KP_ListNBox: RscListNBox { + sizeEx = KP_TEXT_M; +}; + // XListBox class KP_XListBox: RscXListBox { colorBackground[] = KP_COLOR_BACKGROUND; sizeEx = KP_TEXT_M; }; +// Slider +class KP_Slider: RscXSliderH { + color[] = {1, 1, 1, 0.6}; + colorActive[] = {1, 1, 1, 0.6}; +}; + +// Editbox +class KP_EditBox: RscEdit { + colorBackground[] = {0, 0, 0, 0.3}; + sizeEx = KP_TEXT_M; +}; + /* --- Standard sized dialog components --- (X from 0.25 - 0.75, Y from 0.2 - 0.8) @@ -276,7 +308,7 @@ class KP_DialogButtonL: KP_Button { /* --- Corner dialog components --- - (X from 0.035 - 0.285, Y from 0.05 - 0.8) + (X from 0.035 - 0.235, Y from 0.05 - 0.8) */ #define KP_X_VAL_C 0.035 diff --git a/addons/KP_Ranks/config.cpp b/addons/KP_Ranks/config.cpp index 3ea3350..f55e0e3 100644 --- a/addons/KP_Ranks/config.cpp +++ b/addons/KP_Ranks/config.cpp @@ -4,7 +4,7 @@ File: config.cpp Author: Wyqer - https://github.com/KillahPotatoes Date: 2018-07-09 - Last Update: 2018-07-23 + Last Update: 2018-08-21 License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html Description: @@ -22,15 +22,15 @@ class CfgPatches { url = "https://github.com/KillahPotatoes/KP-Ranks"; units[] = {"KPR_force"}; weapons[] = {}; - requiredVersion = 1.82; + requiredVersion = 1.84; requiredAddons[] = { "A3_Modules_F", "cba_main" }; versionDesc = "KP Ranks"; - version = 2.0.1; - versionStr = "2.0.1"; - versionAr[] = {2,0,1}; + version = 2.0.2; + versionStr = "2.0.2"; + versionAr[] = {2,0,2}; authors[] = {"Wyqer"}; }; }; @@ -58,7 +58,7 @@ class CfgSettings { class Extended_PreInit_EventHandlers { class KPR_preInit { - init = "call KPR_fnc_initCBA"; + init = "[] call KPR_fnc_initCBA"; }; }; @@ -68,7 +68,7 @@ class Extended_PreInit_EventHandlers { class Extended_PostInit_EventHandlers { class KPR_postInit { - init = "call KPR_fnc_initRanks"; + init = "[] call KPR_fnc_initRanks"; }; }; @@ -162,12 +162,36 @@ class CfgFunctions { // Request ACE ace_medical_lastDamageSource variable from unit owner class getAceKiller {}; + // Get data of the players rank insignia class + class getInsigniaData {}; + + // Get a players index in the KPR_players array + class getPlayerIndex {}; + + // Get a players playtime formatted to days, hours and minutes + class getPlaytime {}; + + // Get a players playtime in plain minutes + class getPlaytimePlain {}; + // Get the rank of a player class getRank {}; + // Get the name of the rank of a player + class getRankName {}; + + // Get the needed score to keep the current player rank + class getRankScore {}; + + // Get the needed score for a players next rank + class getRankScoreNext {}; + // Get the score of a player class getScore {}; + // Get the index in the KPR_uniforms array of an uniform + class getUniformIndex {}; + // Check if player has at least given rank class hasRank {}; diff --git a/addons/KP_Ranks/fnc/fn_addActions.sqf b/addons/KP_Ranks/fnc/fn_addActions.sqf index 2372e80..5ce987b 100644 --- a/addons/KP_Ranks/fnc/fn_addActions.sqf +++ b/addons/KP_Ranks/fnc/fn_addActions.sqf @@ -4,7 +4,7 @@ File: fn_addActions.sqf Author: Wyqer - https://github.com/KillahPotatoes Date: 2018-07-09 - Last Update: 2018-07-19 + Last Update: 2018-08-21 License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html Description: @@ -31,7 +31,7 @@ if (!isNull _corpse) then { }; KPR_actionIdCheck = player addAction [localize "STR_KPR_ACTION_CHECKRANK", {[true] call KPR_fnc_applyRank;}, nil, -1200, false, true, "", "!KPR_autoMode || KPR_levelSystem"]; -KPR_actionIdPlayers = player addAction [localize "STR_KPR_ACTION_PLAYERMANAGE", {call KPR_fnc_openDialogPlayers;}, nil, -1201, false, true, "", "KPR_isAdmin"]; -KPR_actionIdUniforms = player addAction [localize "STR_KPR_ACTION_UNIFORMMANAGE", {call KPR_fnc_openDialogUniforms;}, nil, -1201, false, true, "", "KPR_isAdmin"]; +KPR_actionIdPlayers = player addAction [localize "STR_KPR_ACTION_PLAYERMANAGE", {[] call KPR_fnc_openDialogPlayers;}, nil, -1201, false, true, "", "KPR_isAdmin"]; +KPR_actionIdUniforms = player addAction [localize "STR_KPR_ACTION_UNIFORMMANAGE", {[] call KPR_fnc_openDialogUniforms;}, nil, -1201, false, true, "", "KPR_isAdmin"]; true diff --git a/addons/KP_Ranks/fnc/fn_addScore.sqf b/addons/KP_Ranks/fnc/fn_addScore.sqf index 545ca3c..40c0c21 100644 --- a/addons/KP_Ranks/fnc/fn_addScore.sqf +++ b/addons/KP_Ranks/fnc/fn_addScore.sqf @@ -4,7 +4,7 @@ File: fn_addScore.sqf Author: Wyqer - https://github.com/KillahPotatoes Date: 2018-07-23 - Last Update: 2018-07-23 + Last Update: 2018-08-21 License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html Description: @@ -22,13 +22,21 @@ if (!isServer) exitWith {false}; params ["_uid", ["_change", 0]]; -private _index = KPR_players findIf {_x select 1 == _uid}; +// Get current score +private _score = [_uid] call KPR_fnc_getScore; // Return false, if uid wasn't found in the players array -if (_index == -1) exitWith {false}; +if (_score == -1) exitWith {false}; -// Adjust score and save -KPR_players select _index set [5, (KPR_players select _index select 5) + _change]; -[KPR_players] call KPR_fnc_savePlayers; +// Adjust score +_score = _score + _change; + +// Prevent negative score +if (_score < 0) then { + _score = 0; +}; + +// Save new score +[_uid, _score] call KPR_fnc_setScore; true diff --git a/addons/KP_Ranks/fnc/fn_applyRank.sqf b/addons/KP_Ranks/fnc/fn_applyRank.sqf index da388e4..cb23a27 100644 --- a/addons/KP_Ranks/fnc/fn_applyRank.sqf +++ b/addons/KP_Ranks/fnc/fn_applyRank.sqf @@ -4,7 +4,7 @@ File: fn_applyRank.sqf Author: Wyqer - https://github.com/KillahPotatoes Date: 2018-07-09 - Last Update: 2018-07-22 + Last Update: 2018-08-21 License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html Description: @@ -23,59 +23,17 @@ params [["_showHint", false]]; // Exit, if KPR_players list is empty. if (KPR_players isEqualTo []) exitWith {}; -// Get current player list index -private _indexP = KPR_players findIf {_x select 1 == getPlayerUID player}; +// Get the insignia data +private _insignia = [] call KPR_fnc_getInsigniaData; -// Get current player rank -private _rank = KPR_players select _indexP select 2; - -// Bool for kind of hint -private _validUniform = false; - -// Configclass of the insignia -private _insigniaClass = configNull; - -// Get index of the current player uniform -private _indexU = KPR_uniforms findIf {_x select 0 == uniform player}; - -// Placeholder with default values -private _material = "\a3\data_f\default.rvmat"; -private _texture = "#(rgb,8,8,3)color(0,0,0,0)"; -private _displayname = "NONE"; - -// Get configClass of the insignia, if player wears a supported uniform -if (_indexU != -1) then { - _validUniform = true; - - private _nation = KPR_uniforms select _indexU select 1; - if (KPR_playerNation) then {_nation = KPR_players select _indexP select 3;}; - - switch (_nation) do { - case 0: {_nation = "BWF";}; - case 1: {_nation = "BWT";}; - case 2: {_nation = "CRO";}; - case 3: {_nation = "USA";}; - default {_nation = "USA";}; - }; - - _insigniaClass = [["CfgUnitInsignia", format ["KPR_%1_%2", _nation, str _rank]], configNull] call BIS_fnc_loadClass; -}; - -// If it's a valid uniform, get specific values for material and texture of the insignia -if (!isNull _insigniaClass) then { - _material = getText (_insigniaClass >> "material"); - _texture = getText (_insigniaClass >> "texture"); - _displayname = getText (_insigniaClass >> "displayname"); -}; - -// Show hint with the picture of the insignia or that the uniform isn't supported +// Show hint with the picture of the insignia or that the uniform isn't activated if (_showHint) then { - if (_validUniform || KPR_playerNation) then { - [_displayname select [6], _texture] call KPR_fnc_showHint; + if (((_insignia select 3) > -1) || KPR_playerNation) then { + [_insignia select 2, _insignia select 1] call KPR_fnc_showHint; } else { - ["Uniform not supported"] call KPR_fnc_showHint; + ["Uniform not activated"] call KPR_fnc_showHint; if (KPR_extendedLog) then { - private _text = format ["[KP RANKS] [%1 (%2)] Uniform not supported: %3", name player, getPlayerUID player, uniform player]; + private _text = format ["[KP RANKS] [%1 (%2)] Uniform not activated: %3", name player, getPlayerUID player, uniform player]; _text remoteExecCall ["diag_log", 2]; }; }; @@ -84,8 +42,8 @@ if (_showHint) then { // Apply insignia { if (_x == "insignia") exitWith { - player setObjectMaterialGlobal [_forEachIndex, _material]; - player setObjectTextureGlobal [_forEachIndex, _texture]; + player setObjectMaterialGlobal [_forEachIndex, _insignia select 0]; + player setObjectTextureGlobal [_forEachIndex, _insignia select 1]; }; } forEach getArray (configFile >> "CfgVehicles" >> getText (configFile >> "CfgWeapons" >> uniform player >> "ItemInfo" >> "uniformClass") >> "hiddenSelections"); diff --git a/addons/KP_Ranks/fnc/fn_autoLoop.sqf b/addons/KP_Ranks/fnc/fn_autoLoop.sqf index a13e048..f501e28 100644 --- a/addons/KP_Ranks/fnc/fn_autoLoop.sqf +++ b/addons/KP_Ranks/fnc/fn_autoLoop.sqf @@ -4,7 +4,7 @@ File: fn_autoLoop.sqf Author: Wyqer - https://github.com/KillahPotatoes Date: 2018-07-09 - Last Update: 2018-07-14 + Last Update: 2018-08-21 License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html Description: @@ -21,10 +21,10 @@ if (!hasInterface) exitWith {}; if (!isMultiplayer) exitWith {}; -if (!KPR_autoMode) exitWith {}; +if (KPR_autoMode || KPR_levelSystem) then { + [false] call KPR_fnc_applyRank; +}; -[false] call KPR_fnc_applyRank; - -[{call KPR_fnc_autoLoop;}, [], KPR_autoModeInterval] call CBA_fnc_waitAndExecute; +[{[] call KPR_fnc_autoLoop;}, [], KPR_autoModeInterval] call CBA_fnc_waitAndExecute; true diff --git a/addons/KP_Ranks/fnc/fn_entityKilled.sqf b/addons/KP_Ranks/fnc/fn_entityKilled.sqf index 756a551..9022cce 100644 --- a/addons/KP_Ranks/fnc/fn_entityKilled.sqf +++ b/addons/KP_Ranks/fnc/fn_entityKilled.sqf @@ -4,7 +4,7 @@ File: fn_entityKilled.sqf Author: Wyqer - https://github.com/KillahPotatoes Date: 2018-07-19 - Last Update: 2018-07-20 + Last Update: 2018-08-21 License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html Description: @@ -38,7 +38,7 @@ if (side group _killed == sideUnknown || side group _killed == sideEnemy || side private _kind = "Infantry"; private _points = KPR_infPoints; -call { +[] call { if (side group _killed == side group _instigator) exitWith {_kind = "Teamkill"; _points = KPR_tkPenalty * -1;}; if ([side group _instigator, side group _killed] call BIS_fnc_sideIsFriendly) exitWith {_kind = "Friendkill"; _points = KPR_tkPenalty * -1;}; if (_killed isKindOf "Car") exitWith {_kind = "Light"; _points = KPR_lvhPoints;}; @@ -46,18 +46,12 @@ call { if (_killed isKindOf "Air") exitWith {_kind = "Air"; _points = KPR_airPoints;}; }; -// Get some player date +// Get player index private _playerId = getPlayerUID _instigator; -private _index = KPR_players findIf {_x select 1 == _playerId}; -private _score = (KPR_players select _index select 5) + _points; +private _index = [_playerId] call KPR_fnc_getPlayerIndex; -// No negative points -if (_score < 0) then { - _score = 0; -}; - -// Update points of player -KPR_players select _index set [5, _score]; +// Apply points to player score +[_playerId, _points] call KPR_fnc_addScore; if (KPR_levelDebug) then { diag_log format [ @@ -67,13 +61,10 @@ if (KPR_levelDebug) then { _kind, typeOf _killed, _points, - _score, + KPR_players select _index select 5, side group _killed == side group _instigator, [side group _instigator, side group _killed] call BIS_fnc_sideIsFriendly ]; }; -// Save updated data -[KPR_players] call KPR_fnc_savePlayers; - true diff --git a/addons/KP_Ranks/fnc/fn_getInsigniaData.sqf b/addons/KP_Ranks/fnc/fn_getInsigniaData.sqf new file mode 100644 index 0000000..827ab96 --- /dev/null +++ b/addons/KP_Ranks/fnc/fn_getInsigniaData.sqf @@ -0,0 +1,78 @@ +/* + KPR_fnc_getInsigniaData + + File: fn_getInsigniaData.sqf + Author: Wyqer - https://github.com/KillahPotatoes + Date: 2018-08-21 + Last Update: 2018-08-21 + License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html + + Description: + Gets specific data of the insignia of the provided player object. + Returns an array with the corresponding insignia data on success or an empty array if no data could be retrieved. + + Parameter(s): + 0: OBJECT - Player object from which the rank should be retrieved (default: player) + + Returns: + ARRAY + 0: STRING - material (rvmat) of the insignia + 1: STRING - path to the texture of the insignia + 2: STRING - rank name without the prefix like "USA11". It only contains the rank name like "Master Sergeant" + 3: NUMBER - index of the player uniform in the KPR_uniforms array, -1 if not wearing an activated uniform +*/ + +params [["_unit", player]]; + +// Initialize return variable +private _return = []; + +// Proceed, if provided unit is a player. Otherwise just return the empty array. +if (isPlayer _unit) then { + // Placeholder with default values + private _material = "\a3\data_f\default.rvmat"; + private _texture = "#(rgb,8,8,3)color(0,0,0,0)"; + private _name = "NONE"; + private _nation = -1; + + // Is the player wearing an activated uniform + private _uniform = [uniform _unit] call KPR_fnc_getUniformIndex; + + // UID of the player + private _uid = getPlayerUID _unit; + + // Get current player list index + private _indexP = [_uid] call KPR_fnc_getPlayerIndex; + + // Get current player rank + private _rank = [_uid] call KPR_fnc_getRank; + + // Configclass of the insignia + private _insigniaClass = configNull; + + // Get the nation of the player or uniform + if (_uniform != -1) then {_nation = KPR_uniforms select _uniform select 1;}; + if (KPR_playerNation) then {_nation = KPR_players select _indexP select 3;}; + + switch (_nation) do { + case 0: {_nation = "BWF";}; + case 1: {_nation = "BWT";}; + case 2: {_nation = "CRO";}; + case 3: {_nation = "USA";}; + default {_nation = "USA";}; + }; + + _insigniaClass = [["CfgUnitInsignia", format ["KPR_%1_%2", _nation, str _rank]], configNull] call BIS_fnc_loadClass; + + // If it's a valid uniform, get specific values for material and texture of the insignia + if (!isNull _insigniaClass) then { + _material = getText (_insigniaClass >> "material"); + _texture = getText (_insigniaClass >> "texture"); + _name = getText (_insigniaClass >> "displayname"); + }; + + // Fill the return array + _return = [_material, _texture, _name select [6], _uniform]; +}; + +_return diff --git a/addons/KP_Ranks/fnc/fn_getPlayerIndex.sqf b/addons/KP_Ranks/fnc/fn_getPlayerIndex.sqf new file mode 100644 index 0000000..3f378b1 --- /dev/null +++ b/addons/KP_Ranks/fnc/fn_getPlayerIndex.sqf @@ -0,0 +1,23 @@ +/* + KPR_fnc_getPlayerIndex + + File: fn_getPlayerIndex.sqf + Author: Wyqer - https://github.com/KillahPotatoes + Date: 2018-08-21 + Last Update: 2018-08-21 + License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html + + Description: + Gets the index of a given player in the KPR_players array. Identified by the Steam UID. + Returns the index as number. If the Steam UID wasn't found it returns -1. + + Parameter(s): + 0: STRING - Steam UID of the player + + Returns: + NUMBER +*/ + +params ["_uid"]; + +KPR_players findIf {_x select 1 == _uid} diff --git a/addons/KP_Ranks/fnc/fn_getPlaytime.sqf b/addons/KP_Ranks/fnc/fn_getPlaytime.sqf new file mode 100644 index 0000000..d930438 --- /dev/null +++ b/addons/KP_Ranks/fnc/fn_getPlaytime.sqf @@ -0,0 +1,30 @@ +/* + KPR_fnc_getPlaytime + + File: fn_getPlaytime.sqf + Author: Wyqer - https://github.com/KillahPotatoes + Date: 2018-08-21 + Last Update: 2018-08-21 + License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html + + Description: + Gets the playtime of the given player as string formatted to days, hours and minutes. + + Parameter(s): + 0: STRING - Steam UID of the player (default: uid of current player) + + Returns: + STRING +*/ + +params [["_uid", getPlayerUID player]]; + +private _playtime = [_uid] call KPR_fnc_getPlaytimePlain; + +// Generate readable time values +private _playtimeD = floor (_playtime / 1440); +_playtime = _playtime % 1440; +private _playtimeH = floor (_playtime / 60); +private _playtimeM = _playtime % 60; + +format ["%1d %2h %3m", _playtimeD, _playtimeH, _playtimeM] diff --git a/addons/KP_Ranks/fnc/fn_getPlaytimePlain.sqf b/addons/KP_Ranks/fnc/fn_getPlaytimePlain.sqf new file mode 100644 index 0000000..991898a --- /dev/null +++ b/addons/KP_Ranks/fnc/fn_getPlaytimePlain.sqf @@ -0,0 +1,22 @@ +/* + KPR_fnc_getPlaytimePlain + + File: fn_getPlaytimePlain.sqf + Author: Wyqer - https://github.com/KillahPotatoes + Date: 2018-08-21 + Last Update: 2018-08-21 + License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html + + Description: + Gets the playtime of the given player in plain minutes. + + Parameter(s): + 0: STRING - Steam UID of the player (default: uid of current player) + + Returns: + NUMBER +*/ + +params [["_uid", getPlayerUID player]]; + +KPR_players select ([_uid] call KPR_fnc_getPlayerIndex) select 6 diff --git a/addons/KP_Ranks/fnc/fn_getRank.sqf b/addons/KP_Ranks/fnc/fn_getRank.sqf index ae70bd2..2554350 100644 --- a/addons/KP_Ranks/fnc/fn_getRank.sqf +++ b/addons/KP_Ranks/fnc/fn_getRank.sqf @@ -4,7 +4,7 @@ File: fn_getRank.sqf Author: Wyqer - https://github.com/KillahPotatoes Date: 2018-07-23 - Last Update: 2018-07-23 + Last Update: 2018-08-21 License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html Description: @@ -12,18 +12,18 @@ Returns the current rank as number. If the Steam UID wasn't found it returns -1. Parameter(s): - 0: STRING - Steam UID of the player + 0: STRING - Steam UID of the player (default: uid of current player) Returns: NUMBER */ -params ["_uid"]; +params [["_uid", getPlayerUID player]]; -private _index = KPR_players findIf {_x select 1 == _uid}; +private _index = [_uid] call KPR_fnc_getPlayerIndex; // Return -1, if uid wasn't found in the players array if (_index == -1) exitWith {_index}; -// Return rank, if player was found +// Return rank number, if player was found KPR_players select _index select 2 diff --git a/addons/KP_Ranks/fnc/fn_getRankName.sqf b/addons/KP_Ranks/fnc/fn_getRankName.sqf new file mode 100644 index 0000000..fb596d1 --- /dev/null +++ b/addons/KP_Ranks/fnc/fn_getRankName.sqf @@ -0,0 +1,22 @@ +/* + KPR_fnc_getRankName + + File: fn_getRankName.sqf + Author: Wyqer - https://github.com/KillahPotatoes + Date: 2018-08-21 + Last Update: 2018-08-21 + License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html + + Description: + Returns the rank name without the prefix like "USA11". It only contains the rank name like "Master Sergeant" + + Parameter(s): + 0: OBJECT - Player object from which the rank name should be retrieved (default: player) + + Returns: + STRING +*/ + +params [["_unit", player]]; + +[_unit] call KPR_fnc_getInsigniaData select 2 diff --git a/addons/KP_Ranks/fnc/fn_getRankScore.sqf b/addons/KP_Ranks/fnc/fn_getRankScore.sqf new file mode 100644 index 0000000..1cec92f --- /dev/null +++ b/addons/KP_Ranks/fnc/fn_getRankScore.sqf @@ -0,0 +1,24 @@ +/* + KPR_fnc_getRankScore + + File: fn_getRankScore.sqf + Author: Wyqer - https://github.com/KillahPotatoes + Date: 2018-08-21 + Last Update: 2018-08-21 + License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html + + Description: + Gets the needed score to keep the current player rank. + + Parameter(s): + 0: STRING - Steam UID of the player (default: uid of current player) + + Returns: + NUMBER +*/ + +params [["_uid", getPlayerUID player]]; + +private _rank = [_uid] call KPR_fnc_getRank; + +missionNamespace getVariable ("KPR_rank" + str _rank) diff --git a/addons/KP_Ranks/fnc/fn_getRankScoreNext.sqf b/addons/KP_Ranks/fnc/fn_getRankScoreNext.sqf new file mode 100644 index 0000000..d0cc04b --- /dev/null +++ b/addons/KP_Ranks/fnc/fn_getRankScoreNext.sqf @@ -0,0 +1,24 @@ +/* + KPR_fnc_getRankScore + + File: fn_getRankScore.sqf + Author: Wyqer - https://github.com/KillahPotatoes + Date: 2018-08-21 + Last Update: 2018-08-21 + License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html + + Description: + Gets the needed score for the next rank of the current player. + + Parameter(s): + 0: STRING - Steam UID of the player (default: uid of current player) + + Returns: + NUMBER +*/ + +params [["_uid", getPlayerUID player]]; + +private _rank = [_uid] call KPR_fnc_getRank; + +missionNamespace getVariable ("KPR_rank" + str (_rank + 1)) diff --git a/addons/KP_Ranks/fnc/fn_getScore.sqf b/addons/KP_Ranks/fnc/fn_getScore.sqf index 9b852f5..abc3443 100644 --- a/addons/KP_Ranks/fnc/fn_getScore.sqf +++ b/addons/KP_Ranks/fnc/fn_getScore.sqf @@ -4,7 +4,7 @@ File: fn_getScore.sqf Author: Wyqer - https://github.com/KillahPotatoes Date: 2018-07-23 - Last Update: 2018-07-23 + Last Update: 2018-08-21 License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html Description: @@ -12,15 +12,15 @@ Returns the current score as number. If the Steam UID wasn't found it returns -1. Parameter(s): - 0: STRING - Steam UID of the player + 0: STRING - Steam UID of the player (default: uid of current player) Returns: NUMBER */ -params ["_uid"]; +params [["_uid", getPlayerUID player]]; -private _index = KPR_players findIf {_x select 1 == _uid}; +private _index = [_uid] call KPR_fnc_getPlayerIndex; // Return -1, if uid wasn't found in the players array if (_index == -1) exitWith {_index}; diff --git a/addons/KP_Ranks/fnc/fn_getUniformIndex.sqf b/addons/KP_Ranks/fnc/fn_getUniformIndex.sqf new file mode 100644 index 0000000..fee7163 --- /dev/null +++ b/addons/KP_Ranks/fnc/fn_getUniformIndex.sqf @@ -0,0 +1,22 @@ +/* + KPR_fnc_getUniformIndex + + File: fn_getUniformIndex.sqf + Author: Wyqer - https://github.com/KillahPotatoes + Date: 2018-08-21 + Last Update: 2018-08-21 + License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html + + Description: + Returns the index from the KPR_uniforms array if activated. Otherwise -1. + + Parameter(s): + 0: STRING - uniform classname (default: classname of current player uniform) + + Returns: + NUMBER +*/ + +params [["_uniform", uniform player]]; + +KPR_uniforms findIf {_x select 0 == _uniform} diff --git a/addons/KP_Ranks/fnc/fn_hasRank.sqf b/addons/KP_Ranks/fnc/fn_hasRank.sqf index cffe97a..2f4b377 100644 --- a/addons/KP_Ranks/fnc/fn_hasRank.sqf +++ b/addons/KP_Ranks/fnc/fn_hasRank.sqf @@ -21,7 +21,7 @@ params ["_uid", ["_rank", 0]]; -private _index = KPR_players findIf {_x select 1 == _uid}; +private _index = [_uid] call KPR_fnc_getPlayerIndex; // Return false, if uid wasn't found in the players array if (_index == -1) exitWith {false}; diff --git a/addons/KP_Ranks/fnc/fn_initACE.sqf b/addons/KP_Ranks/fnc/fn_initACE.sqf index 455a728..3f25705 100644 --- a/addons/KP_Ranks/fnc/fn_initACE.sqf +++ b/addons/KP_Ranks/fnc/fn_initACE.sqf @@ -26,11 +26,11 @@ _action = ["KPR_Admin", "Ranks Admin", "\KP_Ranks\kplogo_ca.paa", {}, {KPR_isAdm [(typeOf player), 1, ["ACE_SelfActions"], _action] call ace_interact_menu_fnc_addActionToClass; // Action to open the player management dialog -_action = ["KPR_PlayerManage", localize "STR_KPR_ACTION_PLAYERMANAGE", "", {call KPR_fnc_openDialogPlayers;}, {KPR_isAdmin}] call ace_interact_menu_fnc_createAction; +_action = ["KPR_PlayerManage", localize "STR_KPR_ACTION_PLAYERMANAGE", "", {[] call KPR_fnc_openDialogPlayers;}, {KPR_isAdmin}] call ace_interact_menu_fnc_createAction; [(typeOf player), 1, ["ACE_SelfActions", "KPR_Admin"], _action] call ace_interact_menu_fnc_addActionToClass; // Action to open the uniform management dialog -_action = ["KPR_UniformManage", localize "STR_KPR_ACTION_UNIFORMMANAGE", "", {call KPR_fnc_openDialogUniforms;}, {KPR_isAdmin}] call ace_interact_menu_fnc_createAction; +_action = ["KPR_UniformManage", localize "STR_KPR_ACTION_UNIFORMMANAGE", "", {[] call KPR_fnc_openDialogUniforms;}, {KPR_isAdmin}] call ace_interact_menu_fnc_createAction; [(typeOf player), 1, ["ACE_SelfActions", "KPR_Admin"], _action] call ace_interact_menu_fnc_addActionToClass; true diff --git a/addons/KP_Ranks/fnc/fn_initCBA.sqf b/addons/KP_Ranks/fnc/fn_initCBA.sqf index c83af3c..47d88d4 100644 --- a/addons/KP_Ranks/fnc/fn_initCBA.sqf +++ b/addons/KP_Ranks/fnc/fn_initCBA.sqf @@ -4,7 +4,7 @@ File: fn_initCBA.sqf Author: Wyqer - https://github.com/KillahPotatoes Date: 2018-07-09 - Last Update: 2018-07-19 + Last Update: 2018-08-21 License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html Description: @@ -24,12 +24,7 @@ [localize "STR_KPR_CBA_AUTOENABLE", localize "STR_KPR_CBA_AUTOENABLEDESC"], "KP Ranks", false, - true, - { - if (KPR_autoMode) then { - call KPR_fnc_autoLoop; - }; - } + true ] call CBA_Settings_fnc_init; // Auto Mode interval slider @@ -69,12 +64,7 @@ [localize "STR_KPR_CBA_LEVELENB", localize "STR_KPR_CBA_LEVELENBDESC"], "KP Ranks Leveling System", false, - true, - { - if (KPR_levelSystem) then { - call KPR_fnc_autoLoop; - }; - } + true ] call CBA_Settings_fnc_init; // Interval for the score update check diff --git a/addons/KP_Ranks/fnc/fn_initRanks.sqf b/addons/KP_Ranks/fnc/fn_initRanks.sqf index 4e21ff5..92aedde 100644 --- a/addons/KP_Ranks/fnc/fn_initRanks.sqf +++ b/addons/KP_Ranks/fnc/fn_initRanks.sqf @@ -4,7 +4,7 @@ File: fn_initRanks.sqf Author: Wyqer - https://github.com/KillahPotatoes Date: 2018-07-09 - Last Update: 2018-08-02 + Last Update: 2018-08-21 License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html Description: @@ -29,9 +29,9 @@ if (isServer) then { KPR_players = profileNamespace getVariable ["KPR_players", []]; if (KPR_players isEqualTo []) then { diag_log "[KP RANKS] [SERVER] No player list on server, initialize empty list..."; - } else { - diag_log "[KP RANKS] [SERVER] Sending player list to clients..."; }; + + diag_log "[KP RANKS] [SERVER] Sending player list to clients..."; publicVariable "KPR_players"; // Load saved or set default uniform list @@ -41,15 +41,15 @@ if (isServer) then { diag_log "[KP RANKS] [SERVER] No uniform list on server, initialize default list..."; // Get default list - call KPR_fnc_setDefaultUniforms; + [] call KPR_fnc_setDefaultUniforms; // Save the default list initially on the server profileNamespace setVariable ["KPR_uniforms", KPR_uniforms]; saveProfileNamespace; - } else { - diag_log "[KP RANKS] [SERVER] Sending uniform list to clients..."; }; + // Provide list of uniforms for clients + diag_log "[KP RANKS] [SERVER] Sending uniform list to clients..."; publicVariable "KPR_uniforms"; // Add mission eventhandler for killed entities @@ -73,14 +73,17 @@ if (isServer) then { }]; // Start score updater - call KPR_fnc_scoreUpdate; + [] call KPR_fnc_scoreUpdate; diag_log format ["[KP RANKS] [SERVER] Finished initialization - Listed Players: %1 - Listed Uniforms: %2 - Auto Mode: %3 - Level System: %4 - Nation by: %5", count KPR_players, count KPR_uniforms, KPR_autoMode, KPR_levelSystem, if (KPR_playerNation) then {"Player"} else {"Uniform"}]; }; if (hasInterface) then { + private _uid = getPlayerUID player; + private _name = name player; + if (KPR_extendedLog) then { - private _text = format ["[KP RANKS] [%1 (%2)] Connected", name player, getPlayerUID player]; + private _text = format ["[KP RANKS] [%1 (%2)] Connected", _name, _uid]; _text remoteExecCall ["diag_log", 2]; }; @@ -91,56 +94,60 @@ if (hasInterface) then { if !(squadParams player isEqualTo []) then { _displayname = "[" + ((squadParams player select 0) select 0) + "] "; }; - _displayname = _displayname + name player; + _displayname = _displayname + _name; // Get and set player rank - private _index = KPR_players findIf {_x select 1 == getPlayerUID player}; + private _index = [_uid] call KPR_fnc_getPlayerIndex; if (_index != -1) then { if (KPR_extendedLog) then { - private _text = format ["[KP RANKS] [%1 (%2)] Found in server list with rank: %3", name player, getPlayerUID player, KPR_players select _index select 2]; + private _text = format ["[KP RANKS] [%1 (%2)] Found in server list with rank: %3", _name, _uid, [_uid] call KPR_fnc_getRank]; _text remoteExecCall ["diag_log", 2]; }; // Update player name, if it has changed if (KPR_players select _index select 0 != _displayname) then { if (KPR_extendedLog) then { - private _text = format ["[KP RANKS] [%1 (%2)] Renamed from %3 to %4", name player, getPlayerUID player, KPR_players select _index select 0, _displayname]; + private _text = format ["[KP RANKS] [%1 (%2)] Renamed from %3 to %4", _name, _uid, KPR_players select _index select 0, _displayname]; _text remoteExecCall ["diag_log", 2]; }; - [[_displayname, getPlayerUID player]] remoteExecCall ["KPR_fnc_updatePlayer", 2]; + [[_displayname, _uid]] remoteExecCall ["KPR_fnc_updatePlayer", 2]; }; } else { // Add player if not in server list if (KPR_extendedLog) then { - private _text = format ["[KP RANKS] [%1 (%2)] Not in server list, adding player to server list.", name player, getPlayerUID player]; + private _text = format ["[KP RANKS] [%1 (%2)] Not in server list, adding player to server list.", _name, _uid]; _text remoteExecCall ["diag_log", 2]; }; - [[_displayname, getPlayerUID player, 0, 3, 0, 0, 0]] remoteExecCall ["KPR_fnc_addPlayer", 2]; + [[_displayname, _uid, 0, 3, 0, 0, 0]] remoteExecCall ["KPR_fnc_addPlayer", 2]; }; // Check for ACE if (KPR_ace) then { if (KPR_extendedLog) then { - private _text = format ["[KP RANKS] [%1 (%2)] ACE detected", name player, getPlayerUID player]; + private _text = format ["[KP RANKS] [%1 (%2)] ACE detected", _name, _uid]; _text remoteExecCall ["diag_log", 2]; }; // Add self interaction menu entries - call KPR_fnc_initACE; + [] call KPR_fnc_initACE; } else { // Add vanilla actions and respawn EH player addEventHandler ["Respawn", { [_this select 1] call KPR_fnc_addActions; }]; - call KPR_fnc_addActions; + [] call KPR_fnc_addActions; }; - call KPR_fnc_isAdmin; + // Start isAdmin Check loop + [] call KPR_fnc_isAdmin; + + // Start rank apply loop + [] call KPR_fnc_autoLoop; if (KPR_extendedLog) then { - private _text = format ["[KP RANKS] [%1 (%2)] Initialization finished", name player, getPlayerUID player]; + private _text = format ["[KP RANKS] [%1 (%2)] Initialization finished", _name, _uid]; _text remoteExecCall ["diag_log", 2]; }; }; diff --git a/addons/KP_Ranks/fnc/fn_isAdmin.sqf b/addons/KP_Ranks/fnc/fn_isAdmin.sqf index 46c3326..5916b50 100644 --- a/addons/KP_Ranks/fnc/fn_isAdmin.sqf +++ b/addons/KP_Ranks/fnc/fn_isAdmin.sqf @@ -4,7 +4,7 @@ File: fn_isAdmin.sqf Author: Wyqer - https://github.com/KillahPotatoes Date: 2018-07-14 - Last Update: 2018-07-14 + Last Update: 2018-08-21 License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html Description: @@ -26,13 +26,13 @@ private _bool = false; if (serverCommandAvailable "#kick") then { _bool = true; } else { - if ((KPR_players select (KPR_players findIf {_x select 1 == getPlayerUID player}) select 4) == 1) then { + if ((KPR_players select ([getPlayerUID player] call KPR_fnc_getPlayerIndex) select 4) == 1) then { _bool = true; }; }; KPR_isAdmin = _bool; -[{call KPR_fnc_isAdmin;}, [], 5] call CBA_fnc_waitAndExecute; +[{[] call KPR_fnc_isAdmin;}, [], 5] call CBA_fnc_waitAndExecute; true diff --git a/addons/KP_Ranks/fnc/fn_openDialogPlayers.sqf b/addons/KP_Ranks/fnc/fn_openDialogPlayers.sqf index 5904324..11d5b6a 100644 --- a/addons/KP_Ranks/fnc/fn_openDialogPlayers.sqf +++ b/addons/KP_Ranks/fnc/fn_openDialogPlayers.sqf @@ -47,7 +47,10 @@ private _ctrl = controlNull; _ctrl ctrlSetText (_x select 0); if (KPR_levelSystem) then { // Tooltip with current points if level system is enabled - _ctrl ctrlSetTooltip format [(localize "STR_KPR_SCORE") + ": %1", _x select 5]; + _ctrl ctrlSetTooltip format [(localize "STR_KPR_SCORE") + ": %1\n%2", _x select 5, [_x select 1] call KPR_fnc_getPlaytime]; + } else { + // Otherwise just the playtime + _ctrl ctrlSetTooltip ([_x select 1] call KPR_fnc_getPlaytime); }; _ctrl ctrlCommit 0; @@ -75,6 +78,7 @@ private _ctrl = controlNull; if (KPR_levelSystem) then { // Disable control, when level system is enabled _ctrl ctrlEnable false; + _ctrl ctrlSetTooltip localize "STR_KPR_DIALOG_RANKDISABLEDTT"; } else { _ctrl ctrlAddEventHandler ["LBSelChanged", format ["['rank', ['%1', _this select 1]] call KPR_fnc_playerAddEdit", _x select 1]]; }; diff --git a/addons/KP_Ranks/fnc/fn_playerAddEdit.sqf b/addons/KP_Ranks/fnc/fn_playerAddEdit.sqf index fa1d1df..aad9f0c 100644 --- a/addons/KP_Ranks/fnc/fn_playerAddEdit.sqf +++ b/addons/KP_Ranks/fnc/fn_playerAddEdit.sqf @@ -4,7 +4,7 @@ File: fn_playerAddEdit.sqf Author: Wyqer - https://github.com/KillahPotatoes Date: 2018-07-13 - Last Update: 2018-07-18 + Last Update: 2018-08-21 License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html Description: @@ -32,7 +32,7 @@ if !((KPR_editPlayers select 1) isEqualTo []) then { // If first edit, get current data if (_index == -1 && _kind != "delete") then { - _index = KPR_editPlayers select 1 pushBack +(KPR_players select (KPR_players findIf {_x select 1 == _values select 0})); + _index = KPR_editPlayers select 1 pushBack +(KPR_players select ([_values select 0] call KPR_fnc_getPlayerIndex)); }; // Change ActiveText control in dialog diff --git a/addons/KP_Ranks/fnc/fn_playerDeath.sqf b/addons/KP_Ranks/fnc/fn_playerDeath.sqf index 918b0c9..aff85bb 100644 --- a/addons/KP_Ranks/fnc/fn_playerDeath.sqf +++ b/addons/KP_Ranks/fnc/fn_playerDeath.sqf @@ -4,11 +4,11 @@ File: fn_playerDeath.sqf Author: Wyqer - https://github.com/KillahPotatoes Date: 2018-07-19 - Last Update: 2018-07-20 + Last Update: 2018-08-21 License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html Description: - Handles respawn of players and substract the penalty to their score, if level system is activated. + Handles respawn of players and substract the respawn penalty to their score. Parameter(s): 0: OBJECT - Entity which respawned @@ -26,25 +26,16 @@ if !(isPlayer _entity) exitWith {}; // Exit, if there is no corpse (e.g. a joining player) if (isNull _corpse) exitWith {}; -// Get some player date +// Get player index private _playerId = getPlayerUID _entity; -private _index = KPR_players findIf {_x select 1 == _playerId}; -private _score = (KPR_players select _index select 5) - KPR_killedPenalty; +private _index = [_playerId] call KPR_fnc_getPlayerIndex; -// No negative points -if (_score < 0) then { - _score = 0; -}; - -// Update points of player -KPR_players select _index set [5, _score]; - -// Save updated data -[KPR_players] call KPR_fnc_savePlayers; +// Apply death penalty +[_playerId, (KPR_killedPenalty * -1)] call KPR_fnc_addScore; // Log if debug is enabled if (KPR_levelDebug) then { - diag_log format ["[KP RANKS] [LEVEL] %1 respawned - New points: %2", KPR_players select _index select 0, _score]; + diag_log format ["[KP RANKS] [LEVEL] %1 respawned - New points: %2", KPR_players select _index select 0, KPR_players select _index select 5]; }; true diff --git a/addons/KP_Ranks/fnc/fn_playerImport.sqf b/addons/KP_Ranks/fnc/fn_playerImport.sqf index ea7dbf4..277f9d9 100644 --- a/addons/KP_Ranks/fnc/fn_playerImport.sqf +++ b/addons/KP_Ranks/fnc/fn_playerImport.sqf @@ -4,7 +4,7 @@ File: fn_playerImport.sqf Author: Wyqer - https://github.com/KillahPotatoes Date: 2018-07-13 - Last Update: 2018-07-14 + Last Update: 2018-08-21 License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html Description: @@ -23,6 +23,6 @@ profileNamespace setVariable ["KPR_pClipboard", nil]; saveProfileNamespace; [KPR_players] remoteExecCall ["KPR_fnc_savePlayers", 2]; closeDialog 0; -[{!dialog}, {call KPR_fnc_openDialogPlayers;}] call CBA_fnc_waitUntilAndExecute; +[{!dialog}, {[] call KPR_fnc_openDialogPlayers;}] call CBA_fnc_waitUntilAndExecute; true diff --git a/addons/KP_Ranks/fnc/fn_playerSave.sqf b/addons/KP_Ranks/fnc/fn_playerSave.sqf index b0da621..ccb21fd 100644 --- a/addons/KP_Ranks/fnc/fn_playerSave.sqf +++ b/addons/KP_Ranks/fnc/fn_playerSave.sqf @@ -4,7 +4,7 @@ File: fn_playerSave.sqf Author: Wyqer - https://github.com/KillahPotatoes Date: 2018-07-13 - Last Update: 2018-07-14 + Last Update: 2018-08-21 License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html Description: @@ -27,7 +27,7 @@ hint localize "STR_KPR_DIALOG_SAVING"; closedialog 0; hint localize "STR_KPR_DIALOG_SAVINGDONE"; [{hintSilent "";}, [], 2] call CBA_fnc_waitAndExecute; - [{!dialog}, {call KPR_fnc_openDialogPlayers;}] call CBA_fnc_waitUntilAndExecute; + [{!dialog}, {[] call KPR_fnc_openDialogPlayers;}] call CBA_fnc_waitUntilAndExecute; } ] call CBA_fnc_waitUntilAndExecute; diff --git a/addons/KP_Ranks/fnc/fn_playerSaveServer.sqf b/addons/KP_Ranks/fnc/fn_playerSaveServer.sqf index d51e652..2565b68 100644 --- a/addons/KP_Ranks/fnc/fn_playerSaveServer.sqf +++ b/addons/KP_Ranks/fnc/fn_playerSaveServer.sqf @@ -4,7 +4,7 @@ File: fn_playerSaveServer.sqf Author: Wyqer - https://github.com/KillahPotatoes Date: 2018-07-14 - Last Update: 2018-07-18 + Last Update: 2018-08-21 License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html Description: @@ -24,20 +24,18 @@ params [["_edits", []]]; KPR_editsDone = false; if !(_edits isEqualTo []) then { - private _uid = ""; private _index = -1; // Handle deletions { - _uid = _x; - KPR_players deleteAt (KPR_players findIf {_x select 1 == _uid}); + KPR_players deleteAt ([_x] call KPR_fnc_getPlayerIndex); } forEach (_edits select 0); // Handle edits { - _uid = _x select 1; - _index = KPR_players findIf {_x select 1 == _uid}; + _index = [_x select 1] call KPR_fnc_getPlayerIndex; + // Skip if the player was marked for deletion after some edits are scheduled on the player if (_index != -1) then { KPR_players set [_index, +_x]; }; diff --git a/addons/KP_Ranks/fnc/fn_scoreUpdate.sqf b/addons/KP_Ranks/fnc/fn_scoreUpdate.sqf index f2738b2..b945e48 100644 --- a/addons/KP_Ranks/fnc/fn_scoreUpdate.sqf +++ b/addons/KP_Ranks/fnc/fn_scoreUpdate.sqf @@ -4,7 +4,7 @@ File: fn_scoreUpdate.sqf Author: Wyqer - https://github.com/KillahPotatoes Date: 2018-07-19 - Last Update: 2018-08-02 + Last Update: 2018-08-21 License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html Description: @@ -25,7 +25,7 @@ if (!isMultiplayer) exitWith {}; if (!isServer) exitWith {}; // Pre-initialize private variables so they won't be always re-initialized as private during the forEach -private _playerId = ""; +private _uid = ""; private _index = -1; private _score = 0; private _rank = 0; @@ -35,14 +35,14 @@ private _keepPoints = 0; { // Player UID and array index in KPR_players for current player - _playerId = getPlayerUID _x; - _index = KPR_players findIf {_x select 1 == _playerId}; + _uid = getPlayerUID _x; + _index = [_uid] call KPR_fnc_getPlayerIndex; // Only continue, if player is in array (maybe he was just deleted by an Admin) if (_index > -1) then { // Get current score and rank - _score = KPR_players select _index select 5; - _rank = KPR_players select _index select 2; + _score = [_uid] call KPR_fnc_getScore; + _rank = [_uid] call KPR_fnc_getRank; // Adjust playtime of the player _newPlaytime = (KPR_players select _index select 6) + KPR_updateInterval; @@ -99,7 +99,7 @@ private _keepPoints = 0; [KPR_players] call KPR_fnc_savePlayers; // Schedule a next call in CBA -[{call KPR_fnc_scoreUpdate;}, [], KPR_updateInterval * 60] call CBA_fnc_waitAndExecute; +[{[] call KPR_fnc_scoreUpdate;}, [], KPR_updateInterval * 60] call CBA_fnc_waitAndExecute; // Log update and track the runtime if (KPR_levelDebug) then { diff --git a/addons/KP_Ranks/fnc/fn_setRank.sqf b/addons/KP_Ranks/fnc/fn_setRank.sqf index 7df4b40..866d85d 100644 --- a/addons/KP_Ranks/fnc/fn_setRank.sqf +++ b/addons/KP_Ranks/fnc/fn_setRank.sqf @@ -4,14 +4,14 @@ File: fn_setRank.sqf Author: Wyqer - https://github.com/KillahPotatoes Date: 2018-07-23 - Last Update: 2018-07-23 + Last Update: 2018-08-21 License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html Description: Sets the rank of a given player to a given rank. Returns true on success and false if the player wasn't found. Parameter(s): - 0: STRING - Steam UID of the player + 0: STRING - Steam UID of the player (default: uid of current player) 1: NUMBER - Rank to set (default: 0) Returns: @@ -20,9 +20,9 @@ if (!isServer) exitWith {false}; -params ["_uid", ["_rank", 0]]; +params [["_uid", getPlayerUID player], ["_rank", 0]]; -private _index = KPR_players findIf {_x select 1 == _uid}; +private _index = [_uid] call KPR_fnc_getPlayerIndex; // Return false, if uid wasn't found in the players array if (_index == -1) exitWith {false}; diff --git a/addons/KP_Ranks/fnc/fn_setScore.sqf b/addons/KP_Ranks/fnc/fn_setScore.sqf index 2a5469a..badaa77 100644 --- a/addons/KP_Ranks/fnc/fn_setScore.sqf +++ b/addons/KP_Ranks/fnc/fn_setScore.sqf @@ -4,14 +4,14 @@ File: fn_setScore.sqf Author: Wyqer - https://github.com/KillahPotatoes Date: 2018-07-23 - Last Update: 2018-07-23 + Last Update: 2018-08-21 License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html Description: Sets the score of a given player to a given value. Returns true on success and false if the player wasn't found. Parameter(s): - 0: STRING - Steam UID of the player + 0: STRING - Steam UID of the player (default: uid of current player) 1: NUMBER - Score to set (default: 0) Returns: @@ -20,9 +20,9 @@ if (!isServer) exitWith {false}; -params ["_uid", ["_score", 0]]; +params [["_uid", getPlayerUID player], ["_score", 0]]; -private _index = KPR_players findIf {_x select 1 == _uid}; +private _index = [_uid] call KPR_fnc_getPlayerIndex; // Return false, if uid wasn't found in the players array if (_index == -1) exitWith {false}; diff --git a/addons/KP_Ranks/fnc/fn_showHint.sqf b/addons/KP_Ranks/fnc/fn_showHint.sqf index b07da55..c9be46e 100644 --- a/addons/KP_Ranks/fnc/fn_showHint.sqf +++ b/addons/KP_Ranks/fnc/fn_showHint.sqf @@ -4,7 +4,7 @@ File: fn_showHint.sqf Author: Wyqer - https://github.com/KillahPotatoes Date: 2018-07-09 - Last Update: 2018-07-19 + Last Update: 2018-08-21 License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html Description: @@ -23,13 +23,13 @@ params [["_text", ""], ["_insignia", ""]]; if (_text != "") then { // If no insignia texture path is provided, display just the text as hint if (_insignia != "") then { - // Add points count, if levelsystem is active + // Display score additionally, if levelsystem is active if (KPR_levelSystem) then { - // Get needed points for next rank and current points of the player - private _index = KPR_players findIf {_x select 1 == getPlayerUID player}; - private _points = KPR_players select _index select 5; - private _neededPoints = missionNamespace getVariable ("KPR_rank" + str ((KPR_players select _index select 2) + 1)); - _text = format ["%1



%3 / %4", _text, _insignia, _points, _neededPoints]; + // Get needed score for next rank and current score of the player + private _uid = getPlayerUID player; + private _score = [_uid] call KPR_fnc_getScore; + private _neededScore = missionNamespace getVariable ("KPR_rank" + str (([_uid] call KPR_fnc_getRank) + 1)); + _text = format ["%1



%3 / %4", _text, _insignia, _score, _neededScore]; } else { _text = format ["%1

", _text, _insignia]; }; diff --git a/addons/KP_Ranks/fnc/fn_uniformImport.sqf b/addons/KP_Ranks/fnc/fn_uniformImport.sqf index 777c9ca..944c755 100644 --- a/addons/KP_Ranks/fnc/fn_uniformImport.sqf +++ b/addons/KP_Ranks/fnc/fn_uniformImport.sqf @@ -4,7 +4,7 @@ File: fn_uniformImport.sqf Author: Wyqer - https://github.com/KillahPotatoes Date: 2018-07-18 - Last Update: 2018-07-18 + Last Update: 2018-08-21 License: GNU General Pubic License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html Description: @@ -23,6 +23,6 @@ profileNamespace setVariable ["KPR_uClipboard", nil]; saveProfileNamespace; [KPR_uniforms] remoteExecCall ["KPR_fnc_saveUniforms", 2]; closeDialog 0; -[{!dialog}, {call KPR_fnc_openDialogUniforms;}] call CBA_fnc_waitUntilAndExecute; +[{!dialog}, {[] call KPR_fnc_openDialogUniforms;}] call CBA_fnc_waitUntilAndExecute; true diff --git a/addons/KP_Ranks/fnc/fn_uniformLBChange.sqf b/addons/KP_Ranks/fnc/fn_uniformLBChange.sqf index d07b736..c05e03e 100644 --- a/addons/KP_Ranks/fnc/fn_uniformLBChange.sqf +++ b/addons/KP_Ranks/fnc/fn_uniformLBChange.sqf @@ -56,7 +56,7 @@ if (_kind == "active") then { }; // Index in uniform list, if active uniform -private _uniformIndex = KPR_uniforms findIf {_x select 0 == configName _config}; +private _uniformIndex = [configName _config] call KPR_fnc_getUniformIndex; // Update details _ctrlsPicture ctrlSetText getText (_config >> "picture"); diff --git a/addons/KP_Ranks/fnc/fn_uniformMove.sqf b/addons/KP_Ranks/fnc/fn_uniformMove.sqf index 60c1734..6bc8f99 100644 --- a/addons/KP_Ranks/fnc/fn_uniformMove.sqf +++ b/addons/KP_Ranks/fnc/fn_uniformMove.sqf @@ -33,7 +33,7 @@ if (_action == "add") then { KPR_uniforms pushBack [_classname, lbCurSel _ctrlsLbDropdown]; } else { _classname = _ctrlsLbAct lbData (lbCurSel _ctrlsLbAct); - KPR_uniforms deleteAt (KPR_uniforms findIf {_x select 0 == _classname}); + KPR_uniforms deleteAt ([_classname] call KPR_fnc_getUniformIndex); }; // Send updated list to server for saving diff --git a/addons/KP_Ranks/fnc/fn_uniformSave.sqf b/addons/KP_Ranks/fnc/fn_uniformSave.sqf index 6d323f7..dd3835b 100644 --- a/addons/KP_Ranks/fnc/fn_uniformSave.sqf +++ b/addons/KP_Ranks/fnc/fn_uniformSave.sqf @@ -26,7 +26,7 @@ private _ctrlsLbDropdown = _dialog displayCtrl 75806; private _classname = _ctrlsLbAct lbData (lbCurSel _ctrlsLbAct);; // Update faction in KPR_uniforms list -KPR_uniforms select (KPR_uniforms findIf {_x select 0 == _classname}) set [1, lbCurSel _ctrlsLbDropdown]; +KPR_uniforms select ([_classname] call KPR_fnc_getUniformIndex) set [1, lbCurSel _ctrlsLbDropdown]; // Send updated list to server for saving [KPR_uniforms] remoteExecCall ["KPR_fnc_saveUniforms", 2]; diff --git a/addons/KP_Ranks/fnc/fn_updatePlayer.sqf b/addons/KP_Ranks/fnc/fn_updatePlayer.sqf index 9fa2119..4cd9feb 100644 --- a/addons/KP_Ranks/fnc/fn_updatePlayer.sqf +++ b/addons/KP_Ranks/fnc/fn_updatePlayer.sqf @@ -4,7 +4,7 @@ File: fn_updatePlayer.sqf Author: Wyqer - https://github.com/KillahPotatoes Date: 2018-07-12 - Last Update: 2018-07-18 + Last Update: 2018-08-21 License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html Description: @@ -23,7 +23,7 @@ params [["_update", []]]; if (_update isEqualTo []) exitWith {diag_log "[KP RANKS] [SERVER] KPR_fnc_updatePlayer called with no data provided.";}; -private _index = KPR_players findIf {_x select 1 == _update select 1}; +private _index = [_update select 1] call KPR_fnc_getPlayerIndex; KPR_players select _index set [0, _update select 0]; [KPR_players] call KPR_fnc_savePlayers; diff --git a/addons/KP_Ranks/stringtable.xml b/addons/KP_Ranks/stringtable.xml index 9d9449a..b5c3a60 100644 --- a/addons/KP_Ranks/stringtable.xml +++ b/addons/KP_Ranks/stringtable.xml @@ -1,235 +1,313 @@ - + + + If this module is placed in the mission it'll create a dependency to this mod inside the mission. If this module is placed in the mission it'll create a dependency to this mod inside the mission. Wenn dieses Modul gesetzt wird, wird eine Abhängigkeit zur Mod erzeugt. Po postawieniu tego modułu w misji, misja będzie zależna od tego moda. + Se este módulo for colocado dentro da missão, ele criará dependência para esse mod nela. + Si este módulo es colocado en la misión creará una dependecia a este mod dentro de la misión. This way it can be ensured that every player loads the mod. This way it can be ensured that every player loads the mod. Hierdurch kann sichergestellt werden, dass jeder Spieler die Mod lädt. W ten sposób można wymusić aby każdy gracz załadował tego moda. + Dessa forma pode ser assegurado que cada player carrega o mod. + De ese modo se puede asegurar que cada jugador cargue el mod. Automatic Mode Automatic Mode Automatik Modus Tryb automatyczny + Modo automático + Modo automático Enabling this will apply the insignia automatically on the players uniform. Enabling this will apply the insignia automatically on the players uniform. Bei Aktivierung wird das Dienstgradabzeichen automatisch auf der Uniform gesetzt und aktualisiert. Właczenie tego spowoduje że insygnia bedą automatycznie dodawane do munduru gracza. + Habilitar essa opção irá aplicar a insignia automaticamente no uniforme dos players. + Habilitando esta opción se aplicará la insignia automáticamente en el uniforme de los jugadores. Automatic Mode Interval Automatic Mode Interval Automatik Modus Intervall Cykl trybu automatycznego + Intervalo do Modo Automático + Intervalo de Modo Automático Interval between each insignia auto assignment in seconds. Interval between each insignia auto assignment in seconds. Intervall in Sekunden zwischen den automatischen Aktualierungen des Dienstgradabzeichens. Okres czasu w sekundach między cyklami automatycznego przypisywania insygniów. + Intervalo entre cada auto aplicação de insígnia em segundos. + Intervalo entre cada auto aplicación de insigna en segundos. Nation connected to player Nation connected to player Nation an Spieler gebunden Nacja powiązana z graczem + Nação conectada ao player + Nación conectada al jugador If enabled, the nationality is connected to the player, otherwise it's set by the uniform. If enabled, the nationality is connected to the player, otherwise it's set by the uniform. Wenn aktiviert, wird die Nationalität auf den Spieler bezogen, ansonsten durch die Uniform festgelegt. Jeżeli włączone gracz będzie otrzymywał insygnia z wybranej nacji, w przeciwnym wypadku insygnia zależą od munduru. + Se ativada, a nacionalidade é conectada ao player, caso contrário é definda pelo uniforme. + Si se activa, la nacionalidad será connectada al jugador, sino será definida por el uniforme. Extended logging Extended logging Erweiterte Logausgabe Rozszerzone logowanie + Logging estendido + Logging extendido If enabled, the serverlog will display additional information from the clients. If enabled, the serverlog will display additional information from the clients. Wenn aktiviert, werden zusätzliche Informationen von den Clients im Serverlog ausgegeben. Włączenie spowoduje że log serwera będzie zawierał dodatkowe informacje o działaniu moda po stronie klientów. + Se ativado, o serverlog irá mostrar informações adicionais dos clientes. + Si se activa, el log del servidor desplegará información adicional de los clientes. Activate Leveling System Activate Leveling System Aktiviere Levelsystem Włącz System Poziomów + Ativar o sistema de levels + Activar Sistema de Niveles Enables the KP Ranks leveling system. It takes care of promotions/degradations depending on kills, deaths and playtime. Enables the KP Ranks leveling system. It takes care of promotions/degradations depending on kills, deaths and playtime. Aktiviert das KP Ranks Levelsystem. Es kümmert sich um die Beförderungen/Degradierungen abhängig zu Kills, Toden und Spielzeit. Włącza funkcjonalność zdobywania poziomów w KP Ranks. Gracz otrzymuje/traci rangi zależnie od ilości zabitych przeciwników oraz czasu spędzonego na serwerze. + Habilita o sistema de levels do KP Ranks. Levando em conta as promoções/degradações dependendo das kills, mortes e tempo de jogo. + Habilita el sistema de niveles de KP Ranks. Se encarga de las promociones/degradaciones dependiendo de kills, muertes y tiempo de juego. Update Interval Update Interval Aktualisierungsintervall Interwał Aktualizacji + Intervalo de update + Intervalo de Actualización Interval in minutes to trigger the level and score updater. Interval in minutes to trigger the level and score updater. Intervall in Minuten, bis zum Aktualisierungsdurchlauf des Levels und der Punkte. Interwał aktualizacji rang oraz punktów w minutach. + Intervalo em minutos para ativar a atualização de level e pontos. + Intervalo en minutos para ejecutar la actualización el nivel y puntaje. Leveling System Debug Leveling System Debug Levelsystem Debug Debugowanie Systemu Poziomów + Debug do Levelsystem + Depuración de Sistema de Niveles If enabled, the serverlog will display additional information of the leveling system events. If enabled, the serverlog will display additional information of the leveling system events. Wenn aktiviert, werden zusätzliche Informationen vom Levelsystem im Serverlog ausgegeben. Po włączeniu log serwera będzie zawierał dodatkowe informacje o zdarzeniach w systemie poziomów. + Se ativada, o serverlog irá mostrar informações adicionais dos eventos do sistema de levels. + Si se activa, el log del servidor desplegará información adicional de los eventos del sistema de niveles. Announce Levelchange Announce Levelchange Level Änderungen mitteilen Ogłaszaj Zmianę Poziomu + Anunciar mudança de level + Anunciar cambio de nivel If enabled, other players get a notification via system chat if a player was promoted/degraded. If enabled, other players get a notification via system chat if a player was promoted/degraded. Wenn aktiviert, bekommen andere Spieler per Systemchat einen Hinweis über die Beförderung/Degradierung eines Spielers. Jeżeli włączone wszyscy gracze zostaną powiadomieni gdy któś zdobędzie/straci poziom. + Se ativado, outros jogadores verão a notificação pelo sisteam de chat se um player foi promovido/degradado. + Si se activa, los demás jugadores reciben una notificación vía chat del sistema, si un jugador es promovido/degradado. Scoring (changes are not retroactive) Scoring (changes are not retroactive) Punktevergabe (Änderungen sind nicht rückwirkend) Przydzielanie punktów (nie działa retroaktywnie) + Pontuação( as mudanças não são retroativas) + Puntuación (los cambios no son retroactivos) Requirements Requirements Voraussetzungen Wymagania + Requerimentos + Requerimientos Infantry Infantry Infanterie Piechota + Infantaria + Infantería Earned score for an infantry kill. Earned score for an infantry kill. Punkte für das Töten eines feindlichen Infanteristen. Ilość punktów za zabicie piechoty. + Pontos ganhos por matar infantaria. + Puntos obtenidos por matar infantería. Light Vehicle Light Vehicle Leichtes Fahrzeug Lekki pojazd + Veículo Leve + Vehículo Ligero Earned score for destroying a light vehicle. Earned score for destroying a light vehicle. Punkte für die Zerstörung eines leichten Fahrzeugs. Ilość punktów za zniszczenie lekkiego pojazdu. + Pontos ganhos por destruir um veículo leve. + Puntos obtenidos por destruir un vehículo ligero. Armored Vehicle Armored Vehicle Gepanzertes Fahrzeug - Opancerzony pojazd. + Opancerzony pojazd + Veículo blindado + Vehículo blindado Earned score for destroying an armored vehicle. Earned score for destroying an armored vehicle. Punkte für die Zerstörung eines gepanzerten Fahrzeugs. Ilość punktów za zniszczenie pojazdu opancerzonego. + Pontos ganhos por destruir um veículo blindado. + Puntos obtenidos por destruir un vehículo blindado. Air Vehicle Air Vehicle Luftfahrzeug Pojazd latający + Veículo Aéreo + Vehículo Aéreo Earned score for destroying an air vehicle. Earned score for destroying an air vehicle. Punkte für die Zerstörung eines Luftfahrzeugs. Ilość punktów za zniszczenie pojazdu latającego. + Pontos ganhos por destruir um veículo aéreo. + Puntos obtenidos por destruir un vehículo aéreo. Playtime Interval Playtime Interval Spielzeitintervall Interwał punktacji za czas gry + Intervalo de tempo de jogo + Intervalo de tiempo jugado Interval in minutes to trigger the playtime points reward. Has to be larger than the update interval. Interval in minutes to trigger the playtime points reward. Has to be larger than the update interval. Intervall in Minuten, um den Erhalt der Spielzeitbelohnungspunkte auszulösen. Muss größer sein als der Aktualisierungsintervall. Okres co jaki są przyznawane punkty za czas gry. Musi być większy niż interwał aktualizacji. + Intervalo em minutos para ativar a recompensa de pontos por tempo de jogo. Tem que ser maior que o intervalo de update. + Intervalo en minutos para ejecutar la recompensa por tiempo de juego. Tiene que ser mayor que el intervalo de actualización Playtime Points Playtime Points Spielzeitpunkte Punkty za czas gry + Pontos por tempo de jogo + Puntos por tiempo de juego Earned score for playing the above playtime on the server. Earned score for playing the above playtime on the server. Punkte für die oben angegebene Spielzeit auf dem Server. Ilość punktów przyznawana za czas gry + Pontos ganhos por ficar jogando no servidor. + Puntos obtenidos por jugar el tiempo indicado anteriormente en el servidor. Teamkill Penalty Teamkill Penalty Eigenbeschuss Strafe Kara za zabicie przyjaznych jednostek + Penalidades por fogo amigo + Penalización por fuego amigo Penalty for killing friendly units. Penalty for killing friendly units. Strafe für das Töten von befreundeten Einheiten. Ilość punktów odejmowana za zabicie przyjaznych jednostek. + Penalidade por matar unidades aliadas. + Penalización por matar unidades aliadas. Death Penalty Death Penalty Ausfallstrafe Kara za śmierć + Penalidade por morte + Penalización por muerte Penalty for being killed. Penalty for being killed. Strafe für den Spieler, wenn er getötet wird. Odejmowana ilość punktów za śmierć. + Penalidade por ser morto. + Penalización por ser asesinado. Rank Level Rank Level Dienstgradebene Poziomy rang + Rank Level + Rango Required score for a player to reach this rank level. Required score for a player to reach this rank level. Benötigte Punkte, damit ein Spieler diese Dienstgradebene erreicht. Wymagana ilość punktów do osiągnięcia tego poziomu. + Pontos necessários para um player alcançar esse rank. + Puntaje requerido para que un jugador aclance este nivel. @@ -238,36 +316,48 @@ Score Punkte Punkty + Pontos + Puntaje Check Rank Check Rank Dienstgrad prüfen Sprawdź rangę + Verificar Rank + Verificar Rango KPR Player Management KPR Player Management KPR Spielerverwaltung KPR Zarządzanie graczami + Gestão de jogador KPR + Gestión del jugador KPR KPR Uniform Management KPR Uniform Management KPR Uniformverwaltung KPR Zarządzanie mundurami + Gestão de uniformes KPR + Gestión de uniformes KPR %1 was promoted. %1 was promoted. %1 wurde befördert. %1 dostał awans. + %1 foi promovido. + %1 fue promovido %1 was degraded. %1 was degraded. %1 wurde degradiert. %1 został zdegradowany. + %1 foi degradado. + %1 fue degradado @@ -276,186 +366,255 @@ KP Ranks - Player Management KP Ranks - Spielerverwaltung KP Ranks - Zarządzanie graczami + KP Ranks - Gestão de Jogador + KP Ranks - Gestión de Jugador Yes Yes Ja Tak + Sim + No No Nein Nie + Não + No Player Player Spieler Gracz + Jogador + Jugaodr KPR Admin KPR Admin KPR Admin KPR Admin + Admin KPR + Admin KPR Rank Rank Dienstgrad Ranga + Rank + Rango + + + Disabled due to the enabled leveling system. + Disabled due to the enabled leveling system. + Deaktiviert aufgrund des aktivierten Levelsystems. + Desativado devido ao sistema de nivelamento ativado. + Deshabilitado debido a que el sistema de niveles se encuentra activado. Nation Nation Nation Nacja + Nação + Nación Delete Delete Löschen Usuń + Excluir + Eliminar Should the player have access to this dialog? Should the player have access to this dialog? Soll der Spieler Zugang zu diesem Dialog haben? Czy gracz powinien mieć dostęp do tego dialogu? + Deveria o jogador ter acesso a esse menu? + El jugador debería tener acceso a este diálogo? Marks this player for deletion upon save. Marks this player for deletion upon save. Markiert den Spieler zur Löschung. Oznacz gracza do usunięcia przy następnym zapisie. + Marcar esse player para a exclusão quando salvar + Marca este jugador para ser eliminado al guardar. Bundeswehr Wood Bundeswehr Wood BW Flecktarn Bundeswehr Leśny + Bundeswehr Selva + Bundeswehr Bosque Bundeswehr Desert Bundeswehr Desert BW Tropentarn Bundeswehr Pustynny + Bundeswehr Deserto + Bundeswehr Desierto Croatian Army Croatian Army Kroatische Armee Chorwacka Armia + Exército Croata + Ejército Croata US Army US Army US Army US Army + Exército Americano + Ejército EU Reset Reset Zurücksetzen Reset + Descartar + Reiniciar Discard all current changes. Discard all current changes. Alle momentanen Änderungen verwerfen. Usuń obecne zmiany. + Descarta todas as alterações recentes. + Descartar cambios Import Import Importieren Importuj + Importar + Importar Imports data from another server via the stored data in your profile. Imports data from another server via the stored data in your profile. Datenimport von einem anderen Server über die gespeicherten Daten in deinem Profil. Importuje dane z innego serwera poprzez dane zapisane w twoim profilu użytkownika. + Importa dados de outros servidor via dados armazenados no seu perfil. + Importar datos de otro servidor vía datos almacenados en tu perfil. Export Export Exportieren Eksportuj + Exportar + Exportar Exports data to a transport variable in your profile. Exports data to a transport variable in your profile. Datenexport der Daten über eine Transportvariable in deinem Profil. Eksportuje dane do zmiennej w twoim profilu użytkownika. + Exportar dados para uma variável de transporte no seu perfil. + Exportar datos a variable de transporte en tu perfil. Export successful. Exports successful. Datenexport erfolgreich. Eksport zakończony powodzeniem. + Exportado com sucesso. + Exportado exitosamente. Save Save Speichern Zapisz + Salvar + Guardar Saves current state of the list. Saves current state of the list. Speichert den aktuellen Stand der Liste. Zapisuje obecny stan listy. + Salva o estado atual da lista + Guarda el estado actual de la lista. Saving changes... Saving changes... Änderungen werden gespeichert... Zapisywanie zmian... + Salvando as mudanças... + Guardando cambios... Save finished. Save finished. Speichern abgeschlossen. Zapisywanie zakończone. + Salvo com sucesso. + Guardado exitosamente. KP Ranks - Uniform Management KP Ranks - Uniform Management KP Ranks - Uniformverwaltung KP Ranks - Zarządzanie mundurami + KP Ranks - Gerenciamento de Uniforme + KP Ranks - Gestión de Uniformes Active Uniforms Active Uniforms Aktive Uniformen Aktywne mundury + Uniformes Ativos + Uniformes Activos Uniform Details Uniform Details Uniformdetails Szczegóły mundurów + Detalhes do uniforme + Detalles de Uniforme Inactive Uniforms Inactive Uniforms Inaktive Uniformen Nieaktywne mundury + Uniformes Inativos + Uniformes Inactivos Add selected uniform to the active list. Add selected uniform to the active list. Ausgewählte Uniform den aktiven Uniformen hinzufügen. Dodaj wybrane mundury do aktywnych. + Adicionar o uniforme selecionado para a lista ativa. + Agregar el uniforme seleccionado a la lista activa. Remove selected uniform from the active list. Remove selected uniform from the active list. Ausgewählte Uniform von den aktiven Uniformen entfernen. Usuń wybrane mundury z listy aktywnych. + Remove o uniforme selecionado da lista ativa. + Remover el uniforme seleccionado de la lista activa. diff --git a/mod.cpp b/mod.cpp index faf0027..dea0acb 100644 --- a/mod.cpp +++ b/mod.cpp @@ -1,8 +1,8 @@ -name = "KP Ranks 2.0.1"; +name = "KP Ranks 2.0.2"; picture = "kplogo_ca.paa"; actionName = "GitHub"; action = "https://github.com/KillahPotatoes/KP-Ranks"; -description = "KP Ranks - Version 2.0.1"; +description = "KP Ranks - Version 2.0.2"; logo = "kplogo_ca.paa"; logoOver = "kplogo_ca.paa"; tooltip = "KP Ranks";