Sign in to follow this  
Followers 0
Xnetsrac

Die Kill-Mesage oben links (Skripter)

1 post in this topic

Moin, ich versuche seit einigen Tage 2 Scripte zu kombinieren, jedoch scheitere ich ständig dran. Daher suche ich ein Skripter, der mir hilft.

Es geht um die Anzeige die links mittig angezeigt wird, wenn mann ein AI gekillt hat mit dem Respektgewinn.
Aktuell sieht es so aus:
ai_kill_1.png

 

mir der SQF
 

/*
   Author: IT07

   Description:
   handles giving respect to players after killing AI

   Params:
   _this select 0: OBJECT - the AI that was killed
   _this select 1: OBJECT - the killer (must be a player)
*/






private ["_unit","_killer", "_victim","_startTime","_grpUnits","_alertDist","_intelligence","_weapons","_killersVehicle","_handle","_launcher","_runover","_unitMission","_killerRespectPoints", "_fragAttributes", "_killerPlayerUID", "_lastKillAt", "_vehicleKiller", "_killStack", "_distance", "_distanceBonus", "_overallRespectChange", "_newKillerScore", "_killMessage", "_newKillerFrags","_collision"];
_unit = _this select 0;
_killer = _this select 1;


_victim 	= _this select 1;
_collision 	= _this select 2;


_fragAttributes = [];
_killerPlayerUID = getPlayerUID _killer;
_vehicleKiller = (vehicle _killer);
_launcher = secondaryWeapon _unit;
_alertDist = _unit getVariable ["alertDist",300];
_intelligence = _unit getVariable ["intelligence",1];



if (!(isPlayer _killer)) exitWith {};



{
	if ((getPlayerUID _x) isEqualTo _killerPlayerUID) exitWith {
		_killer = _x;
	};
} forEach (crew _vehicleKiller);

if (A3XAI_enableRespectRewards) then {
	_killerRespectPoints = [];
	
	if (_vehicleKiller isEqualTo _killer) then {
		if (currentWeapon _killer isEqualTo "Exile_Melee_Axe") then {
			if (A3XAI_respectHumiliation > 0) then {
				_fragAttributes pushBack "Humiliation";
				_killerRespectPoints pushBack ["HUMILIATION", A3XAI_respectHumiliation];
			};
		} else {
			if (A3XAI_respectFragged > 0) then {
				//_fragAttributes pushBack "ENEMY FRAGGED";
				_fragAttributes pushBack "ENEMY AI FRAGGED";
				//_killerRespectPoints pushBack ["ENEMY FRAGGED", A3XAI_respectFragged];
				_killerRespectPoints pushBack ["ENEMY AI FRAGGED", A3XAI_respectFragged];
			};
		};
	} else {
		if (_collision) then {
			call {
				if (_vehicleKiller isKindOf "ParachuteBase") exitWith {
					if (A3XAI_respectChute > 0) then {
						_fragAttributes pushBack "Chute > Chopper";
						_killerRespectPoints pushBack ["CHUTE > CHOPPER", A3XAI_respectChute];
					};
				};
				if (_vehicleKiller isKindOf "Air") exitWith {
					if (A3XAI_respectBigBird > 0) then {
						_fragAttributes pushBack "Big Bird";
						_killerRespectPoints pushBack ["BIG BIRD", A3XAI_respectBigBird];
					};
				};
				if (A3XAI_respectRoadkill > 0) then {
					_fragAttributes pushBack "Road Kill";
					_killerRespectPoints pushBack ["Road Kill", A3XAI_respectRoadkill];
				};
			};
		} else {
			if (A3XAI_respectLetItRain > 0) then {
				_fragAttributes pushBack "Let it Rain";
				_killerRespectPoints pushBack ["LET IT RAIN", A3XAI_respectLetItRain];
			};
		};
	};
	
	_lastKillAt = _killer getVariable ["A3XAI_LastKillAt", 0];
	_killStack = _killer getVariable ["A3XAI_KillStack", 0];
	if ((diag_tickTime - _lastKillAt) < (getNumber (configFile >> "CfgSettings" >> "Respect" >> "Bonus" >> "killStreakTimeout"))) then {
		if (A3XAI_respectKillstreak > 0) then {
			_killStack = _killStack + 1;
			_fragAttributes pushBack (format ["%1x Kill Streak", _killStack]);
			_killerRespectPoints pushBack [(format ["%1x KILL STREAK", _killStack]), _killStack * A3XAI_respectKillstreak];
			_fragAttributes pushBack (format ["%1x Kill Streak", _killStack]);
		};
		
	} else {
		_killStack = 1;
	};
	_killer setVariable ["A3XAI_KillStack", _killStack];
	_killer setVariable ["A3XAI_LastKillAt", diag_tickTime];
	
/*	
_distance = floor (_victim distance _killer);
_fragAttributes pushBack (format ["%1  Distance", _distance]);
_distanceBonus = ((floor (_distance / 100)) * A3XAI_respectPer100m);
if (_distanceBonus > 0) then {
_killerRespectPoints pushBack [(format ["%1m RANGE BONUS", _distance]), _distanceBonus];
};
*/
	_overallRespectChange = 0;
	{
		_overallRespectChange = _overallRespectChange + (_x select 1);
	} forEach _killerRespectPoints;

	if (_overallRespectChange > 0) then {
		_newKillerScore = _killer getVariable ["ExileScore", 0];
		_newKillerScore = _newKillerScore + _overallRespectChange;
		_killer setVariable ["ExileScore", _newKillerScore];
		format["setAccountScore:%1:%2", _newKillerScore,_killerPlayerUID] call ExileServer_system_database_query_fireAndForget;
		[_killer, "showFragRequest", [_killerRespectPoints]] call A3XAI_sendExileMessage;
	};
	
	//["systemChatRequest", [_killMessage]] call ExileServer_system_network_send_broadcast; //To-do: Non-global version
	_newKillerFrags = _killer getVariable ["ExileKills", 0];
	_killer setVariable ["ExileKills", _newKillerFrags + 1];
	format["addAccountKill:%1", _killerPlayerUID] call ExileServer_system_database_query_fireAndForget;

	_killer call ExileServer_object_player_sendStatsUpdate;
};

 

gern möchte ich aber noch einen angezeigten Rangebonus eingefügt haben, was ich in diesem Script habe:



_target = param [0, objNull, [objNull]];
_killer = param [1, objNull, [objNull]];
_fragAttributes = [];
if not(isNull _target AND isNull _killer) then
{
   scopeName "outer";
   _respectReward = "respectReward" call VEMFr_fnc_getSetting;
   if (_respectReward > 1) then
   {
      _message = [[]];
      _killMsg = selectRandom ["AI WACKED","AI CLIPPED","AI DISABLED","AI DISQUALIFIED","AI WIPED","AI ERASED","AI LYNCHED","AI WRECKED","AI NEUTRALIZED","AI SNUFFED","AI WASTED","AI ZAPPED"];
      (_message select 0) pushBack [_killMsg,_respectReward];
      _dist = _target distance _killer;
      private ["_distanceOk"];
      if (_dist < 2500) then
      {
         scopeName "below2500";
         if (_dist <= 5) then
         {
            (_message select 0) pushBack ["Kuschelbonus", 25];
            _distanceOk = true;
            _distanceOk breakOut "below2500";
         };
         if (_dist <= 10) then
         {
            (_message select 0) pushBack ["Gefärlich Nah", 15];
            _distanceOk = true;
            _distanceOk breakOut "below2500";
         };
         if (_dist <= 50) then
         {
            (_message select 0) pushBack ["Nah dran", 15];
            _distanceOk = true;
            _distanceOk breakOut "below2500";
         };
         if (_dist <= 100) then
         {
            (_message select 0) pushBack ["Tödliches Ziel", 20];
            _distanceOk = true;
            _distanceOk breakOut "below2500";
         };
         if (_dist <= 200) then
         {
            (_message select 0) pushBack ["Tödlich.", 25];
            _distanceOk = true;
            _distanceOk breakOut "below2500";
         };
         if (_dist <= 500) then
         {
            (_message select 0) pushBack ["Woooow.", 30];
            _distanceOk = true;
            _distanceOk breakOut "below2500";
         };
         if (_dist <= 1000) then
         {
            (_message select 0) pushBack ["Weit weg...", 45];
            _distanceOk = true;
            _distanceOk breakOut "below2500";
         };
         if (_dist <= 2000) then
         {
            (_message select 0) pushBack ["Gefährlich weit.", 50];
            _distanceOk = true;
            _distanceOk breakOut "below2500";
         };
         if (_dist > 2000) then
         {
            (_message select 0) pushBack [format["Hack an? %1m!!!", round _dist], 65];
            _distanceOk = true;
            _distanceOk breakOut "below2500";
         };
      };
	  

      if _distanceOk then
      {
         _curRespect = _killer getVariable ["ExileScore", nil];
         if not(isNil"_curRespect") then
         {
            _respectToGive = (((_message select 0) select 1) select 1);
      //    _newRespect = _curRespect + _respectToGive + _respectReward; - bearbeitet da Hauptrespekt oben
          	_newRespect = _curRespect + _respectReward;  //edit ohne hauptrespekt
            _killer setVariable ["ExileScore", _newRespect];
            ExileClientPlayerScore = _newRespect;
            (owner _killer) publicVariableClient "ExileClientPlayerScore";
            ExileClientPlayerScore = nil;
            [_killer, "showFragRequest", _message] call ExileServer_system_network_send_to;
            format["setAccountMoneyAndRespect:%1:%2:%3", _killer getVariable ["ExileMoney", 0], _newRespect, (getPlayerUID _killer)] call ExileServer_system_database_query_fireAndForget;
         } else
         {
            ["fn_aiKilled", 0, format["Failed to get respect from %1 (%2)", name _killer, _killer]] ExecVM "exile_vemf_reloaded\sqf\log.sqf";
         };
      } else
      {
         ["handleKillMessage", 0, format["There is something wrong with the kill distance (%1)", _dist]] ExecVM "exile_vemf_reloaded\sqf\log.sqf";
         breakOut "outer"; // Stop doing anything after this line
      };
   };
};

 

Wenn ich dieses so laufen lasse, legen sich beide Bilder (sihe oben) übereinander und man kann es nicht lesen. Das einzige was klappte, wenn ich zwischen beiden ein "uisleep;" eingebunden hab.

Wie schaffe ich es das so zu vereinen, das es nur noch eine Anzeige ist in form von:

Enemy AI Fragged  100  // obere Script
weit weg                    45 // untere Script
Kill Streak                100 // obere script
------------------------------------------
                                 245

 

Danke im Vorraus bin für hilfen auch im TS erreichbar..einfach anfragen

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.