Mit diesem System können Leute ab einem Bestimmten Rang jeden beliebigen Spieler befördern und/oder degradieren!
1. Erstell unter core/AAR/RankUp 2 Dateien
fn_rankMenue.sqf
Spoiler anzeigen
#include "..\..\..\script_macros.hpp"
/*
* File: fn_rankMenue.sqf
* Author: ԄӏՖҚ - Fabian
* Server: AllAboutRoleplay.de
*
* Description:
* Öffnet das RankUp Menü.
*
*/
disableSerialization;
if (playerSide isEqualTo civilian) exitWith {};
createDialog "life_rankUp";
private _display = findDisplay 999;
private _players = _display displayCtrl 9991;
lbClear _players;
if(playerSide isEqualTo west && (FETCH_CONST(life_coplevel) < 12)) exitWith { ["Dein Rang ist zu Niedrig.","FAST","DEFAULT"] spawn aar_fnc_message;};
if(playerSide isEqualTo independent && (FETCH_CONST(life_mediclevel) < 8)) exitWith { ["Dein Rang ist zu Niedrig.","FAST","DEFAULT"] spawn aar_fnc_message;};
{
private _side = switch (side _x) do {case west: {"Polizei"}; case independent : {"EMS"}; case civilian : {"Zivilist"}; default {"Unbekannt"};};
_players lbAdd format ["%1 - %2", name _x,_side];
_players lbSetData [(lbSize _players)-1,str(_x)];
} forEach playableUnits;
Alles anzeigen
fn_rankUp.sqf
Spoiler anzeigen
#include "..\..\..\script_macros.hpp"
/*
* File: fn_rankUp.sqf
* Author: ԄӏՖҚ - Fabian
* Server: AllAboutRoleplay.de
*
* Description:
* Empfängt die Eingabe des Spielers und gibt diese an die Datenbank weiter.
*
*/
private ["_side","_type","_list","_unit","_rank"];
private _unit = lbData[9991,lbCurSel (9991)];
_unit = call compile format ["%1", _unit];
if (isNil "_unit") exitWith {};
if (isNull _unit) exitWith {};
if (_unit isEqualTo player) exitWith {[localize "STR_ANOTF_Error","FAST","DEFAULT"] spawn aar_fnc_message;};
//rang nehmen
_txtRoh = ctrlText 9992;
_txtF = _txtRoh splitString ",";
if(count _txtF != 2) exitWith {["Benutzung: Eingabe ins Textfeld-> Rang,Polizei oder Rang,EMS OHNE LEERZEICHEN NACH DEM KOMMA!","FAST","DEFAULT"] spawn aar_fnc_message;};
if((_txtF select 1) isEqualTo "") exitWith {["Benutzung: Eingabe ins Textfeld-> Rang,Polizei oder Rang,EMS OHNE LEERZEICHEN NACH DEM KOMMA!","FAST","DEFAULT"] spawn aar_fnc_message;};
_rank = parseNumber(_txtF select 0);
_seite = switch(_txtF select 1) do {
case "Polizei": {west};
case "EMS": {independent};
};
if (_rank > 14) exitWith {["Es gibt nicht mehr als 14 Ränge.","FAST","DEFAULT"] spawn aar_fnc_message;};
if (_rank < 0) exitWith {};
if (!([str(_rank)] call TON_fnc_isnumber)) exitWith {[localize "STR_ATM_notnumeric","FAST","DEFAULT"] spawn aar_fnc_message;};
[_rank, getPlayerUID _unit, _seite, _unit] remoteExec ["AARSV_fnc_resetRankUp", 2];
Alles anzeigen
2. geht in eure Functions.hpp und tragt folgendes ein -> NICHT IN DIE CLASS LIFE_CLIENT CORE!
Spoiler anzeigen
3. Geht in eure cfg RemoteExec und tragt folgendes ein
4. Geht in den Dialog Ordner und erstellt einen neuen Dialog aarRankUpDialog.hpp
Spoiler anzeigen
/* #Feloxy
$[
1.063,
["aarRankUp",[[0,0,1,1],0.025,0.04,"GUI_GRID"],0,0,0],
[1000,"rankUpBackground",[1,"",["0.319532 * safezoneW + safezoneX","0.434 * safezoneH + safezoneY","0.216563 * safezoneW","0.319 * safezoneH"],[-1,-1,-1,-1],[0,0,0,0.5],[-1,-1,-1,-1],"","-1"],[]],
[1400,"rankText",[1,"Polizei 0-14 Ärzte 0-10",["0.324687 * safezoneW + safezoneX","0.654 * safezoneH + safezoneY","0.20625 * safezoneW","0.022 * safezoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]],
[2400,"buttonRankUp",[1,"Rang verändern.",["0.324687 * safezoneW + safezoneX","0.687 * safezoneH + safezoneY","0.20625 * safezoneW","0.022 * safezoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]],
[1500,"",[1,"",["0.324687 * safezoneW + safezoneX","0.445 * safezoneH + safezoneY","0.20625 * safezoneW","0.198 * safezoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]],
[2401,"buttonClose",[1,"Schließen!",["0.324687 * safezoneW + safezoneX","0.72 * safezoneH + safezoneY","0.20625 * safezoneW","0.022 * safezoneH"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]]
]
*/
class life_rankUp {
idd = 999;
name= "life_rankUp";
movingEnable = 1;
enableSimulation = 1;
class controlsBackground {
class rankUpBackground: Life_RscText
{
idc = 1000;
x = 0.319532 * safezoneW + safezoneX;
y = 0.434 * safezoneH + safezoneY;
w = 0.216563 * safezoneW;
h = 0.319 * safezoneH;
colorBackground[] = {0,0,0,0.5};
};
};
class controls {
class rankText: Life_RscEdit
{
idc = 9992;
text = "rang,seite"; //--- ToDo: Localize;
x = 0.324687 * safezoneW + safezoneX;
y = 0.654 * safezoneH + safezoneY;
w = 0.20625 * safezoneW;
h = 0.022 * safezoneH;
};
class buttonRankUp: Life_RscButtonMenu
{
idc = 2400;
text = "Rang verändern."; //--- ToDo: Localize;
onButtonClick = "[] call aar_fnc_rankUp;";
x = 0.324687 * safezoneW + safezoneX;
y = 0.687 * safezoneH + safezoneY;
w = 0.20625 * safezoneW;
h = 0.022 * safezoneH;
};
class RscListbox_1500: Life_RscListbox
{
idc = 9991;
onLBSelChanged = "";
text = "";
sizeEx = 0.035;
x = 0.324687 * safezoneW + safezoneX;
y = 0.445 * safezoneH + safezoneY;
w = 0.20625 * safezoneW;
h = 0.198 * safezoneH;
};
class buttonClose: Life_RscButtonMenu
{
idc = 2401;
text = "Schließen!"; //--- ToDo: Localize;
onButtonClick = "closeDialog 0;";
x = 0.324687 * safezoneW + safezoneX;
y = 0.72 * safezoneH + safezoneY;
w = 0.20625 * safezoneW;
h = 0.022 * safezoneH;
};
};
};
Alles anzeigen
tragt diesen auch in die MasterHandler ein
5 Geht in euren Life_server und erstellt eine neue Datei unter life_server/Functions/AAR/rankUp
fn_resetRankUp.sqf
Spoiler anzeigen
/*
* File: fn_resetRankUp.sqf
* Author: ԄӏՖҚ - Fabian
* Server: AllAboutRoleplay.de
*
* Description:
* Reset the "perso" and set the new cop/med rank.
*
*/
params [
"_insert",
"_uid",
["_side",sideUnknown,[sideUnknown]],
["_player",objNull,[objNull]]
];
//reset the perso
_query = switch(_side) do
{
case west:
{
format["UPDATE perso SET persoCop='""[]""' WHERE pid='%1'", _uid];
};
case independent:
{
format["UPDATE perso SET persoMed='""[]""' WHERE pid='%1'", _uid];
};
};
[_query,1] call DB_fnc_asyncCall;
//set the new rank
_query2 = switch(_side) do
{
case west:
{
format["UPDATE players SET coplevel='%1' WHERE pid='%2'", _insert,_uid];
};
case independent:
{
format["UPDATE players SET mediclevel='%1' WHERE pid='%2'", _insert,_uid];
};
};
[_query2,1] call DB_fnc_asyncCall;
["rankUp",false] remoteExecCall ["BIS_fnc_endMission",(owner _player)];
Alles anzeigen
6. Als letztes tragt ihr das ganze noch in die config.cpp ein dies ist wieder eine neue class
class AAR_Functions {
tag = "AARSV";
class RankUp {
file = "\life_server\Functions\AAR\rankUp";
class resetRankUp {};
}; };
Viel Spaß Damit !
EDIT:
description.ext eintrag in der class debriefing.
class rankUp
{
title = "Rangänderrung";
subTitle = "";
description = "Bitte ändere deinen Namen!";
pictureBackground = "";
picture = "";
pictureColor[] = {0,0.3,0.6,1};
};
kann aufgerufen werden durch
Das System resetet unteranderem auch diesen Perso falls die Namen beim rankup geändert werden müssen.
[Tutorial] Permanenter Personalausweis/Dienstausweis - ID Card