Jump to content
DAKA

1.0.6.1 + InfiStar

Recommended Posts

So with Epoch 1.0.5.1 and infistar, you have an option to add some code to at.sqf so that you can add coins to a player. With the new 1.0.6.1 and single currency, is there a way to add coins or is someone have a work around for infistar to do it?

Share this post


Link to post
Share on other sites

In AT.sqf find: 

adminadd = adminadd + ["  Give -2500 Humanity",adminHumanityMinus,"0","0","0","1",[0,0.8,1,1]];

Add below:

		adminadd = adminadd + ["  Change Coins",changeCoins,"0","0","0","1",[0,0.8,1,1]];
		adminadd = adminadd + ["  Give +25,000 Coins",adminCoinsPlus,"0","0","0","1",[0,0.8,1,1]];
		adminadd = adminadd + ["  Give -25,000 Coins",adminCoinsMinus,"0","0","0","1",[0,0.8,1,1]];	

Find this code block down further (Yours may be a little different):

	adminHumanityMinus = {
		{
			if (name _x == _this select 0) then {
				_humanity = _x getVariable['humanity',0];
				_x setVariable['humanity',_humanity - 2500,true];
				hint format['Gave %1 -2500 Humanity!',_this select 0];
				
				_sl = format['%1 minus 2500 Humanity to %2',name player,_this select 0];
				PVAH_WriteLogReq = [player,toArray _sl];
				publicVariableServer 'PVAH_WriteLogReq';
			};
		} forEach playableUnits;
	};

Add this block below:

	changeCoins = {
		disableSerialization;
		_plr = objNull;	
		{if (name _x == _this select 0) exitWith {_plr = _x;};} forEach playableUnits;
		if (isNull _plr) exitWith {systemchat 'Select a Player!';};
		if (isNull findDisplay 24) exitWith {systemchat format ['open the chat, type the amount of %1 you want to add (can be negative) and doubleClick again!',CurrencyName];};
		
		_chat = (findDisplay 24) displayCtrl 101;
		_txt = ctrlText _chat;
		_num = 0;
		if (_txt != '') then {
			_num = parseNumber _txt;
			if (typeName _num != 'SCALAR') then {systemchat 'INSERT A NUMBER!';};
			(findDisplay 24) closeDisplay 0;
		};
		
		_coins = _plr getVariable[Z_moneyVariable,0];
		_plr setVariable[Z_moneyVariable,_coins+_num,true];
		hint format['Gave %1 %2 %3!',_this select 0,_num,CurrencyName];
		
		_sl = format['%1 %2 %4 to %3',name player,_num,_this select 0,CurrencyName];
		PVAH_WriteLogReq = [player,toArray _sl];
		publicVariableServer 'PVAH_WriteLogReq';
	};
	adminCoinsPlus =	{
		{
			if (name _x == _this select 0) then {
				_coins = _x getVariable[Z_moneyVariable,0];
				_x setVariable[Z_moneyVariable,_coins + 25000,true];
				hint format['Gave %1 +25,000 %2!',_this select 0,CurrencyName];
				
				_sl = format['%1 +25,000 %3 to %2',name player,_this select 0,CurrencyName];
				PVAH_WriteLogReq = [player,toArray _sl];
				publicVariableServer 'PVAH_WriteLogReq';
			};
		} forEach playableUnits;
	};
	adminCoinsMinus = {
		{
			if (name _x == _this select 0) then {
				_coins = _x getVariable[Z_moneyVariable,0];
				_x setVariable[Z_moneyVariable,_coins - 25000,true];
				hint format['Gave %1 -25,000 %2!',_this select 0,CurrencyName];
				
				_sl = format['%1 -25,000 %3 to %2',name player,_this select 0,CurrencyName];
				PVAH_WriteLogReq = [player,toArray _sl];
				publicVariableServer 'PVAH_WriteLogReq';
			};
		} forEach playableUnits;
	};

That is straight from my server so that should work OK (maybe, haha)

Share this post


Link to post
Share on other sites

To add coins to spectate view:

Find this line in AT.sqf:

_log2 = format['Blood: %1  Humanity: %2',(_unit getVariable['USEC_BloodQty',12000]),(_unit getVariable['humanity',0])];

Replace with this line:

_log2 = format['Blood: %1  Humanity: %2  Coins: %3',_unit getVariable['USEC_BloodQty',12000],_unit getVariable['humanity',0],[(_unit getVariable [z_moneyVariable,0])] call BIS_fnc_numberText];

 

Share this post


Link to post
Share on other sites

what if i do not have an at.sqf? I only have ah.sqf in the ah folder. even did a search for it. not there. i used to have 1 in my old overpoch server but the 1061 server didnt come with 1. is there any other way to do it?

Share this post


Link to post
Share on other sites

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

  • Advertisement
  • Advertisement
  • Supporters
  • Advertisement
  • Discord

×