Hey !
Voici mon premier tuto qui consiste a avoir des id au dessus de la tête. Vous pouvez configurer le nom des grades et ainsi que le chemin de la texture pour l'icon dans le fn_playerTags.sqf.
Lets'go
Rendez vous dans votre fn_playerTags.sqf qui se situe dans le dossier core\functions de votre mission
Remplacer le par :
Puis rendez vous dans votre fn_requestReceived.sqf qui se situe dans le dossier \core\session de votre mission.
Après ce bloc
Ajoutez
Puis après ce bloc
Rajoutez
Et pour finir après ce bloc
Ajoutez
Et enfin rendez vous votre life_server puis dans le fichier fn_queryRequest.sqf qui se situe dans le dossier \Functions\MySQL de votre life_server.
Trouvez cette ligne :
Faite la même chose pour la ligne 31 et 33.
Et voila n'oubliez pas de repack votre life_server.
Voici mon premier tuto qui consiste a avoir des id au dessus de la tête. Vous pouvez configurer le nom des grades et ainsi que le chemin de la texture pour l'icon dans le fn_playerTags.sqf.
Lets'go
Rendez vous dans votre fn_playerTags.sqf qui se situe dans le dossier core\functions de votre mission
Remplacer le par :
Code:
#include "..\..\script_macros.hpp"
/*
File: fn_playerTags.sqf
Author: Bryan "Tonic" Boardwine
Description:
ID Joueurs
*/
if (!life_settings_tagson) exitWith {};
private ["_ui","_units","_masks"];
#define iconID 78000
#define scale 0.8
if (visibleMap || {!alive player} || {dialog}) exitWith {
500 cutText["","PLAIN"];
};
_ui = uiNamespace getVariable ["Life_HUD_nameTags",displayNull];
if (isNull _ui) then {
500 cutRsc["Life_HUD_nameTags","PLAIN"];
_ui = uiNamespace getVariable ["Life_HUD_nameTags",displayNull];
};
_units = nearestObjects[(visiblePosition player),["CAManBase","Land_Pallet_MilBoxes_F","Land_Sink_F"],50];
_units = _units - [player];
_masks = LIFE_SETTINGS(getArray,"clothing_masks");
private _index = -1;
{
private _texteID = format["ID : %1",_x getVariable ["id_player", 0]];
private "_text";
_idc = _ui displayCtrl (iconID + _forEachIndex);
if (!(lineIntersects [eyePos player, eyePos _x, player, _x]) && alive _x && {!isNil "_texteID"}) then {
_pos = switch (typeOf _x) do {
case "Land_Pallet_MilBoxes_F": {[visiblePosition _x select 0, visiblePosition _x select 1, (getPosATL _x select 2) + 1.5]};
case "Land_Sink_F": {[visiblePosition _x select 0, visiblePosition _x select 1, (getPosATL _x select 2) + 2]};
default {[visiblePosition _x select 0, visiblePosition _x select 1, ((_x modelToWorld (_x selectionPosition "head")) select 2)+.5]};
};
_sPos = worldToScreen _pos;
_distance = _pos distance player;
if (!((headgear _x) in _masks || (goggles _x) in _masks || (uniform _x) in _masks)) then {
if (count _sPos > 1 && {_distance < 15}) then {
_text = switch (true) do
{
case (_x in (units group player) && playerSide isEqualTo civilian):
{
format ["<t color='#00FF00'>%1</t>",_texteID];
};
case (side _x isEqualTo west && {!isNil {_x getVariable "rank"}}):
{
private _texte_format = "";
switch (playerSide) do
{
case civilian:
{
_texte_format = "<t size ='1'>%3</t>";
};
case west:
{
_texte_format = "<img image='%1' size='1'></img> <t size ='1'>%2</t><br/>%3<br/>%4";
};
case independent:
{
_texte_format = "<img image='%1' size='1'></img> <t size ='1'>%2</t><br/>%3<br/>%4";
};
};
format [_texte_format,
switch ((_x getVariable "rank")) do
{
case 1: {"SunWise_Core\Gendarmerie\gav.paa"};
case 2: {"SunWise_Core\Gendarmeriee\gendarme.paa"};
case 3: {"SunWise_Core\Gendarmerie\marechal_des_logis_chef.paa"};
case 4: {"SunWise_Core\Gendarmerie\adjudant.paa"};
case 5: {"SunWise_Core\Gendarmerie\major.paa"};
case 6: {"SunWise_Core\Gendarmerie\sous_lieutenant.paa"};
case 7: {"SunWise_Core\Gendarmerie\lieutenant.paa"};
case 8: {"SunWise_Core\Gendarmerie\Capitaine.paa"};
case 9: {"SunWise_Core\Gendarmerie\Commandan.paa"};
case 10: {"SunWise_Core\Gendarmerie\Colonel.paa"};
case 11: {"SunWise_Core\Gendarmerie\General.paa"};
default {"\a3\ui_f\data\gui\cfg\Ranks\private_gs.paa"};
},
switch ((_x getVariable "rank")) do
{
case 1: {"GAV"};
case 2: {"Gendarme"};
case 3: {"Maréchal des Logis Chef"};
case 4: {"Adjudant"};
case 5: {"Major"};
case 6: {"Sous-Lieutenant"};
case 7: {"Lieutenant"};
case 8: {"Capitaine"};
case 9: {"Commandant"};
case 10: {"Colonel"};
case 11: {"Général"};
},
_texteID,
name _x];
};
case (side _x isEqualTo independent):
{
private _texte_format = "";
switch (playerSide) do
{
case civilian:
{
_texte_format = "<t size ='1'>%3</t>";
};
case west:
{
_texte_format = "<img image='%1' size='1'></img> <t size ='1'>%2</t><br/>%3<br/>%4";
};
case independent:
{
_texte_format = "<img image='%1' size='1'></img> <t size ='1'>%2</t><br/>%3<br/>%4";
};
};
format [_texte_format,
switch ((_x getVariable "rank_medic")) do
{
case 1: {"SunWise_Core\SP\2nd.paa"};
case 2: {"SunWise_Core\SP\1eresp.paa"};
case 3: {"SunWise_Core\SP\caposp.paa"};
case 4: {"SunWise_Core\SP\capocsp.paa"};
case 5: {"SunWise_Core\SP\sgsp.paa"};
case 6: {"SunWise_Core\SP\sgscsp.paa"};
case 7: {"SunWise_Core\SP\adjsp.paa"};
case 8: {"SunWise_Core\SP\adjcsp.paa"};
case 9: {"SunWise_Core\SP\ltsp.paa"};
case 10: {"SunWise_Core\SP\cptsp.paa"};
case 11: {"SunWise_Core\SP\commsp.paa"};
case 12: {"SunWise_Core\SP\ltcolsp.paa"};
case 13: {"SunWise_Core\SP\colsp.paa"};
default {"a3\ui_f\data\gui\cfg\Ranks\private_gs.paa"};
},
switch ((_x getVariable "rank_medic")) do
{
case 1: {"Seconde Classe"};
case 2: {"Première Classe"};
case 3: {"Caporal"};
case 4: {"Caporal-Chef"};
case 5: {"Sergent"};
case 6: {"Sergent-Chef"};
case 7: {"Adjudant"};
case 8: {"Adjudant-Chef"};
case 9: {"Lieutenant"};
case 10: {"Capitaine"};
case 11: {"Commandant"};
case 12: {"Lieutenant-Colonel"};
case 13: {"Colonel"};
},
_texteID,
name _x];
};
default
{
if (!isNil {(group _x) getVariable "gang_name"}) then {
format ["%1<br/><t size='0.8' color='#B6B6B6'>%2</t>",_texteID/*(group _x) getVariable ["gang_name",""]*/];
} else {
if (alive _x) then {
_texteID;
} else {
if (!isPlayer _x) then {
_x getVariable ["realname","ERROR"];
};
};
};
};
};
_idc ctrlSetStructuredText parseText _text;
_idc ctrlSetPosition [_sPos select 0, _sPos select 1, 0.4, 0.65];
_idc ctrlSetScale scale;
_idc ctrlSetFade 0;
_idc ctrlCommit 0;
_idc ctrlShow true;
} else {
_idc ctrlShow false;
};
} else {
_idc ctrlShow false;
};
} else {
_idc ctrlShow false;
};
_index = _forEachIndex;
} forEach _units;
(_ui displayCtrl (iconID + _index + 1)) ctrlSetStructuredText parseText "";
Puis rendez vous dans votre fn_requestReceived.sqf qui se situe dans le dossier \core\session de votre mission.
Après ce bloc
Code:
case west: {
CONST(life_coplevel,(_this select 7));
CONST(life_medicLevel,0);
life_blacklisted = _this select 9;
if (LIFE_SETTINGS(getNumber,"save_playerStats") isEqualTo 1) then {
life_hunger = ((_this select 10) select 0);
life_thirst = ((_this select 10) select 1);
player setDamage ((_this select 10) select 2);
};
Code:
//Recup de l'id + setVariable.
private _id = _this select 12;
player setVariable["id_player", _id, true];
};
Puis après ce bloc
Code:
//Position
if (LIFE_SETTINGS(getNumber,"save_civilian_position") isEqualTo 1) then {
life_is_alive = _this select 10;
life_civ_position = _this select 11;
if (life_is_alive) then {
if !(count life_civ_position isEqualTo 3) then {diag_log format ["[requestReceived] Bad position received. Data: %1",life_civ_position];life_is_alive =false;};
if (life_civ_position distance (getMarkerPos "respawn_civilian") < 300) then {life_is_alive = false;};
};
};
Rajoutez
Code:
//Recup de l'id + setVariable.
private _id = _this select 13;
player setVariable["id_player", _id, true];
Et pour finir après ce bloc
Code:
case independent: {
CONST(life_medicLevel,(_this select 7));
CONST(life_coplevel,0);
if (LIFE_SETTINGS(getNumber,"save_playerStats") isEqualTo 1) then {
life_hunger = ((_this select 9) select 0);
life_thirst = ((_this select 9) select 1);
player setDamage ((_this select 9) select 2);
};
Ajoutez
Code:
//Recup de l'id + setVariable.
private _id = _this select 11;
player setVariable["id_player", _id, true];
};
};
Et enfin rendez vous votre life_server puis dans le fichier fn_queryRequest.sqf qui se situe dans le dossier \Functions\MySQL de votre life_server.
Trouvez cette ligne :
case west: {format ["SELECT pid, name, cash, bankacc, adminlevel, donorlevel, cop_licenses, coplevel, cop_gear, blacklist, cop_stats, playtime, uid FROM players WHERE pid='%1'",_uid];};
et ajoutez : , uid de cette manière :case west: {format ["SELECT pid, name, cash, bankacc, adminlevel, donorlevel, cop_licenses, coplevel, cop_gear, blacklist, cop_stats, playtime, uid FROM players WHERE pid='%1'",_uid];};
Faite la même chose pour la ligne 31 et 33.
Et voila n'oubliez pas de repack votre life_server.
Dernière édition: