Jump to content

[Release] Admin Tools view/add/remove currency from players


Recommended Posts

Oh that must be it.

Im using Zupa's Gui for banking but not the Hud that comes with SC.

 

Not a problem, i followed the achmed's post and i've done it his way , works great.

 

Thanks for the help anyway :)

 

Ok, great. No problem.

Link to comment
Share on other sites

  • 3 months later...

To add it to the infiSTAR menu with out any additional files you need to set the amount to give per click and cant enter an amount to give or view there balance etc.

 

for those who want to do it that way this is how you do it.

 

This gives you the option to give and remove 100,1000,10000 & 100000 coins to a selected player

 

 

Find

                adminadd = adminadd + ["  Give Ammo",admin_give_ammo,"0","0","0","1",[0,0.8,1,1]];

On the line before this add

		adminadd = adminadd + ["  Give -10000 Humanity",adminHumanityMinus10000,"0","0","0","1",[0,0.8,1,1]];
		adminadd = adminadd + ["  Give +100 Coins to player",adminCashAdd100,"0","0","0","1",[0,0.8,1,1]];
		adminadd = adminadd + ["  Give +1000 Coins to player",adminCashAdd1000,"0","0","0","1",[0,0.8,1,1]];
		adminadd = adminadd + ["  Give +10000 Coins to player",adminCashAdd10000,"0","0","0","1",[0,0.8,1,1]];
		adminadd = adminadd + ["  Give +100000 Coins to player",adminCashAdd100000,"0","0","0","1",[0,0.8,1,1]];
		adminadd = adminadd + ["  Give -100 Coins to player",adminCashRemove100,"0","0","0","1",[0,0.8,1,1]];
		adminadd = adminadd + ["  Give -1000 Coins to player",adminCashRemove1000,"0","0","0","1",[0,0.8,1,1]];
		adminadd = adminadd + ["  Give -10000 Coins to player",adminCashRemove10000,"0","0","0","1",[0,0.8,1,1]];
		adminadd = adminadd + ["  Give -100000 Coins to player",adminCashRemove100000,"0","0","0","1",[0,0.8,1,1]];

Find

	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,_sl];
				publicVariableServer 'PVAH_WriteLogReq';
			};
		} forEach playableUnits;
	};

Add after

	adminCashAdd100 =
	{
		{
			if (name _x == _this select 0) then
			{
				_cash = _x getVariable['cashMoney',0];
				_x setVariable['cashMoney',_cash+100,true];
				hint format ['Gave %1 100 Coins!',_this select 0];
				
				_sl = format['%1 100 Coins to %2',name player,_this select 0];
				PVAH_WriteLogReq = [player,_sl];
				publicVariableServer 'PVAH_WriteLogReq';
			};
		} forEach playableUnits;
	};
	adminCashAdd1000 =
	{
		{
			if (name _x == _this select 0) then
			{
				_cash = _x getVariable['cashMoney',0];
				_x setVariable['cashMoney',_cash+1000,true];
				hint format ['Gave %1 1000 Coins!',_this select 0];
				
				_sl = format['%1 1000 Coins to %2',name player,_this select 0];
				PVAH_WriteLogReq = [player,_sl];
				publicVariableServer 'PVAH_WriteLogReq';
			};
		} forEach playableUnits;
	};
	adminCashAdd10000 =
	{
		{
			if (name _x == _this select 0) then
			{
				_cash = _x getVariable['cashMoney',0];
				_x setVariable['cashMoney',_cash+10000,true];
				hint format ['Gave %1 10000 Coins!',_this select 0];
				
				_sl = format['%1 10000 Coins to %2',name player,_this select 0];
				PVAH_WriteLogReq = [player,_sl];
				publicVariableServer 'PVAH_WriteLogReq';
			};
		} forEach playableUnits;
	};
	adminCashAdd100000 =
	{
		{
			if (name _x == _this select 0) then
			{
				_cash = _x getVariable['cashMoney',0];
				_x setVariable['cashMoney',_cash+100000,true];
				hint format ['Gave %1 100000 Coins!',_this select 0];
				
				_sl = format['%1 100000 Coins to %2',name player,_this select 0];
				PVAH_WriteLogReq = [player,_sl];
				publicVariableServer 'PVAH_WriteLogReq';
			};
		} forEach playableUnits;
	};
	adminCashRemove100 =
	{
		{
			if (name _x == _this select 0) then
			{
				_cash = _x getVariable['cashMoney',0];
				_x setVariable['cashMoney',_cash-100,true];
				hint format ['Gave %1 -100 Coins!',_this select 0];
				
				_sl = format['%1 -100 Coins to %2',name player,_this select 0];
				PVAH_WriteLogReq = [player,_sl];
				publicVariableServer 'PVAH_WriteLogReq';
			};
		} forEach playableUnits;
	};
	adminCashRemove1000 =
	{
		{
			if (name _x == _this select 0) then
			{
				_cash = _x getVariable['cashMoney',0];
				_x setVariable['cashMoney',_cash-1000,true];
				hint format ['Gave %1 -1000 Coins!',_this select 0];
				
				_sl = format['%1 -1000 Coins to %2',name player,_this select 0];
				PVAH_WriteLogReq = [player,_sl];
				publicVariableServer 'PVAH_WriteLogReq';
			};
		} forEach playableUnits;
	};
	adminCashRemove10000 =
	{
		{
			if (name _x == _this select 0) then
			{
				_cash = _x getVariable['cashMoney',0];
				_x setVariable['cashMoney',_cash-10000,true];
				hint format ['Gave %1 -10000 Coins!',_this select 0];
				
				_sl = format['%1 -10000 Coins to %2',name player,_this select 0];
				PVAH_WriteLogReq = [player,_sl];
				publicVariableServer 'PVAH_WriteLogReq';
			};
		} forEach playableUnits;
	};
	adminCashRemove100000 =
	{
		{
			if (name _x == _this select 0) then
			{
				_cash = _x getVariable['cashMoney',0];
				_x setVariable['cashMoney',_cash-100000,true];
				hint format ['Gave %1 -100000 Coins!',_this select 0];
				
				_sl = format['%1 -100000 Coins to %2',name player,_this select 0];
				PVAH_WriteLogReq = [player,_sl];
				publicVariableServer 'PVAH_WriteLogReq';
			};
		} forEach playableUnits;
	};

I did also try to do the same for the banked money. In game it showed that the money had changed however if the player logged out before doing any banking the database was not updated. Not sure why this happened as the only difference is the variable used. Didnt bother looking into it much as the above works as the player can just bank the money them self

Im pretty sure this is someone elses script.

For got his name but im sure he released it the same day as zupa released his currency script.

Here: http://devzupa.be/forum/viewtopic.php?id=3

Link to comment
Share on other sites

  • 4 weeks later...

What about Zupa's Single Currency 3.0 (default hive, no global bank)? Is either version stored in the same location in database, or will I need to change something to make it work with 3.0?

 

to use this with ZSC use this:

 

add to currency_dialog.hpp at the top of the file

//------------- Zupa's Single Currency 3.0 -------------//

class Life_RscText {
	x = 0;
	y = 0;
	h = 0.037;
	w = 0.3;
	type = 0;
	style = 0;
	shadow = 1;
	colorShadow[] = {0, 0, 0, 0.5};
	font = "Zeppelin32";
	SizeEx = "(			(			(			((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
	text = "";
	colorText[] = {1, 1, 1, 1.0};
	colorBackground[] = {0, 0, 0, 0};
	linespacing = 1;
	tooltipColorText[] = {1,1,1,1};
	tooltipColorBox[] = {1,1,1,1};
	tooltipColorShade[] = {0,0,0,0.65};
};
class RscTextT
{
	access = 0;
	type = 0;
	idc = -1;
	colorBackground[] = {0,0,0,0};
	colorText[] = {0.8784,0.8471,0.651,1};
	text = "";
	fixedWidth = 0;
	x = 0;
	y = 0;
	h = 0.037;
	w = 0.3;
	style = 0;
	shadow = 2;
	font = "Zeppelin32";
	SizeEx = 0.03921;
};

class Life_RscEdit {
	type = 2;
	style = 0x00 + 0x40;
	font = "Zeppelin32";
	shadow = 2;
	sizeEx = "(			(			(			((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
	colorBackground[] = {0, 0, 0, 1};

	colorText[] = {0.95, 0.95, 0.95, 1};
	colorDisabled[] = {1, 1, 1, 0.25};
	autocomplete = false;
	colorSelection[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 1};
	canModify = 1;
	soundPush[] = { "", 0, 1 };
	soundEnter[] =	{ "", 0, 1 };
	soundClick[] ={ "", 0, 1 };
	soundEscape[] ={ "", 0, 1 };
	sound[] ={ "", 0, 1 };
};
		
class Life_RscTitle : Life_RscText {
	style = 0;
	sizeEx = "(			(			(			((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
	colorText[] = {0.95, 0.95, 0.95, 1};
};

class Life_RscShortcutButton {
	idc = -1;
	style = 0;
	default = 0;
	shadow = 1;
	w = 0.183825;
	h = "(		(		((safezoneW / safezoneH) min 1.2) / 1.2) / 20)";
	color[] = {1,1,1,1.0};
	colorFocused[] = {1,1,1,1.0};
	color2[] = {0.95,0.95,0.95,1};
	colorDisabled[] = {1,1,1,0.25};
	colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",1};
	colorBackgroundFocused[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",1};
	colorBackground2[] = {1,1,1,1};
	animTextureDefault = "gui\normal_ca.paa";
	animTextureNormal = "gui\normal_ca.paa";
	animTextureDisabled = "gui\normal_ca.paa";
	animTextureOver = "gui\over_ca.paa";
	animTextureFocused = "gui\focus_ca.paa";
	animTexturePressed = "gui\down_ca.paa";
	periodFocus = 1.2;
	periodOver = 0.8;
	class HitZone
	{
		left = 0.0;
		top = 0.0;
		right = 0.0;
		bottom = 0.0;
	};
	class ShortcutPos
	{
		left = 0;
		top = "(			(		(		((safezoneW / safezoneH) min 1.2) / 1.2) / 20) - 		(			(			(			((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2";
		w = "(			(			(			((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1) * (3/4)";
		h = "(			(			(			((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
	};
	class TextPos
	{
		left = "(			(			(			((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1) * (3/4)";
		top = "(			(		(		((safezoneW / safezoneH) min 1.2) / 1.2) / 20) - 		(			(			(			((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2";
		right = 0.005;
		bottom = 0.0;
	};
	period = 0.4;
	font = "Zeppelin32";
	size = "(			(			(			((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
	sizeEx = "(			(			(			((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
	text = "";
	action = "";
	class Attributes
	{
		font = "Zeppelin32";
		color = "#E5E5E5";
		align = "left";
		shadow = "true";
	};
	class AttributesImage
	{
		font = "Zeppelin32";
		color = "#E5E5E5";
		align = "left";
	};
	
	soundPush[] = { "", 0, 1 };
	soundEnter[] =	{ "", 0, 1 };
	soundClick[] ={ "", 0, 1 };
	soundEscape[] ={ "", 0, 1 };
	sound[] ={ "", 0, 1 };
};

class Life_RscButtonMenu : Life_RscShortcutButton {
	idc = -1;
	type = 16;
	style = "0x02 + 0xC0";
	default = 0;
	shadow = 0;
	x = 0;
	y = 0;
	w = 0.095589;
	h = 0.039216;
	animTextureNormal = "#(argb,8,8,3)color(1,1,1,1)";
	animTextureDisabled = "#(argb,8,8,3)color(1,1,1,1)";
	animTextureOver = "#(argb,8,8,3)color(1,1,1,1)";
	animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)";
	animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)";
	animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)";
	colorBackground[] = {0,0,0,0.8};
	colorBackgroundFocused[] = {1,1,1,1};
	colorBackground2[] = {0.75,0.75,0.75,1};
	color[] = {1,1,1,1};
	colorFocused[] = {0,0,0,1};
	color2[] = {0,0,0,1};
	colorText[] = {1,1,1,1};
	colorDisabled[] = {1,1,1,0.25};
	period = 1.2;
	periodFocus = 1.2;
	periodOver = 1.2;
	size = "(			(			(			((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
	sizeEx = "(			(			(			((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
	tooltipColorText[] = {1,1,1,1};
	tooltipColorBox[] = {1,1,1,1};
	tooltipColorShade[] = {0,0,0,0.65};
	class TextPos
	{
		left = "0.25 * 			(			((safezoneW / safezoneH) min 1.2) / 40)";
		top = "(			(			(			((safezoneW / safezoneH) min 1.2) / 1.2) / 25) - 		(			(			(			((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2";
		right = 0.005;
		bottom = 0.0;
	};
	class Attributes
	{
		font = "Zeppelin32";
		color = "#E5E5E5";
		align = "left";
		shadow = "false";
	};
	class ShortcutPos
	{
		left = "(6.25 * 			(			((safezoneW / safezoneH) min 1.2) / 40)) - 0.0225 - 0.005";
		top = 0.005;
		w = 0.0225;
		h = 0.03;
	};
	textureNoShortcut = "";
};

//------------- Zupa's Single Currency 3.0 -------------//

 

same file disable the bank buttons with /* */ like this

/*        class CurrencyAddBankButton : life_RscButtonMenu 
		{
			idc = -1;
			text = "Add bank";
			colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
			onButtonClick = "[(ctrlText 15003),currencyTarget,'add','bank'] spawn CurrencyTransferMoney; ((ctrlParent (_this select 0)) closeDisplay 9000);";
			colorText[] = {0.8784,0.8471,0.651,1};
			x = 0.4;
			y = 0.495;
			w = (6 / 30);
			h = (1 / 25);
		}; */
/*		class CurrencyRemoveBankButton : life_RscButtonMenu 
		{
			idc = -1;
			text = "Remove bank";
			colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 0.5};
			onButtonClick = "[(ctrlText 15003),currencyTarget,'remove','bank'] spawn CurrencyTransferMoney; ((ctrlParent (_this select 0)) closeDisplay 9000);";
			colorText[] = {0.8784,0.8471,0.651,1};
			x = 0.4;
			y = 0.585;
			w = (6 / 30);
			h = (1 / 25);
		}; */

 

then it should work

Link to comment
Share on other sites

  • 4 months later...

I did the fix for zsc 3.0 and still get no dialog box, error went away except for one in the prt. but no dialog box. I'm going to try to debug this again today, but if anyone has a fix or having the same issue, let me know how or if you worked it out. I'll post my fix when i can.

Link to comment
Share on other sites

  • 4 months later...
On 20/08/2015 at 8:13 PM, deicide said:

I did the fix for zsc 3.0 and still get no dialog box, error went away except for one in the prt. but no dialog box. I'm going to try to debug this again today, but if anyone has a fix or having the same issue, let me know how or if you worked it out. I'll post my fix when i can.

had the same problem had a play about and managed to get the dialog box to work now see the box and can give and remove coins as intended

apply Zupa's Single Currency 3.0 fix as above then copy and paste in admintoolsmain.sqf

["Currency Menu >>",[],"#USER:CurrencyMenu", -5, [["expression", ""]], "1", "1"],

under

["Humanity Menu >>",[],"#USER:HumanityMenu", -5, [["expression", ""]], "1", "1"],

then under

//Main menu to handle humanity changing
HumanityMenu =
[
["",true],
    ["Add Humanity to self or target", [],"", -5, [["expression", '["add"] execVM "admintools\tools\humanityChanger.sqf"']], "1", "1"],
    ["Remove Humanity from self or target", [],"", -5, [["expression", '["remove"] execVM "admintools\tools\humanityChanger.sqf"']], "1", "1"],
        ["", [], "", -5, [["expression", ""]], "1", "0"],
        ["Main Menu", [20], "#USER:epochmenustart", -5, [["expression", ""]], "1", "1"]
];

copy and paste

//Main menu to handle currency

CurrencyMenu =
[
["",true],
    ["Add Currency to self or target", [],"", -5, [["expression", '["add"] execVM "admintools\tools\currency.sqf"']], "1", "1"],
    ["Remove Currency from self or target", [],"", -5, [["expression", '["remove"] execVM "admintools\tools\currency.sqf"']], "1", "1"],
        ["", [], "", -5, [["expression", ""]], "1", "0"],
        ["Main Menu", [20], "#USER:epochmenustart", -5, [["expression", ""]], "1", "1"]
];

save & exit Admintoolsmain.sqf

then move currency.sqf from currency folder to admintools\tools\

hope this fixes the problem for you

 

 

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 year later...

Hi everybody,

i'm new in the forum and step by step, with the forum's tutorial, i creating a epoch server 1.0.6.1.

I'm not a programmer, but after two night without sleep, i think founded a solution for integrate "add/remove coin" in Noxsicarius Admin Tool 1.10.7.

Maybe someone will have done it already, but i still want to share this my little satisfaction with you and contribute to the forum. :)

How to proceed:

Of course it must already be installed the Admin Tools 1.10.7 on Epoch server 1.0.6.1.

1) Go to the yourmissionfolder\admintools and open (with notepad++) the file AdminToolsMain.sqf

2) Find the line

EAT_adminMenu = EAT_adminMenu + [["Humanity Menu >>",[],"#USER:EAT_humanityMenu", -5, [["expression", ""]], "1", "1"]];

and add below

EAT_adminMenu = EAT_adminMenu + [["Coin Menu >>",[],"#USER:EAT_coinMenu", -5, [["expression", ""]], "1", "1"]];

3) Now, find the line

EAT_humanityMenu = EAT_humanityMenu + [["Main Menu", [20], "#USER:EAT_mainMenu", -5, [["expression", ""]], "1", "1"]];

and add below

//Main menu to handle coin changing
    EAT_coinMenu = [["",true]];
    EAT_coinMenu = EAT_coinMenu + [["-- Coin Change Menu --", [], "", -5,[["expression", ""]], "1", "0"]];
    EAT_coinMenu = EAT_coinMenu + [["Add to self or target", [],"", -5, [["expression", '["add"] execVM "admintools\tools\coinChanger.sqf"']], "1", "1"]];
    EAT_coinMenu = EAT_coinMenu + [["Remove from self or target", [],"", -5, [["expression", '["remove"] execVM "admintools\tools\coinChanger.sqf"']], "1", "1"]];
    EAT_coinMenu = EAT_coinMenu + [["Reset to 0", [],"", -5, [["expression", '["reset"] execVM "admintools\tools\coinChanger.sqf"']], "1", "1"]];
    EAT_coinMenu = EAT_coinMenu + [["", [], "", -5,[["expression", ""]], "1", "0"]];
    EAT_coinMenu = EAT_coinMenu + [["Main Menu", [20], "#USER:EAT_mainMenu", -5, [["expression", ""]], "1", "1"]];

4) Save and close the file.

5) Go to the yourmissionfolder\admintools\tools and create a new sqf file and rename it coinChanger.sqf.

6) Now paste into this file this lines

/*
    Add or remove the selected coin amount from player.
*/

private ["_target","_player","_Z_MoneyVariable","_addOrRemove"];
_addOrRemove = _this select 0;
_target = cursorTarget;
_player = player;

if(!isPlayer _target) then {_target = _player;};

coinGain = -1;
_Z_MoneyVariable = _target getVariable[Z_MoneyVariable, 0];

if(_addOrRemove != "reset") then {
    EAT_coinChange = [
        ["",true],
        ["Select coin amount:", [-1], "", 0, [["expression", ""]], "1", "0"],
        ["100", [2], "", -5, [["expression", "coinGain=100;"]], "1", "1"],
        ["500", [3], "", -5, [["expression", "coinGain=500;"]], "1", "1"],
        ["5000", [4], "", -5, [["expression", "coinGain=5000;"]], "1", "1"],
        ["10000", [5], "", -5, [["expression", "coinGain=10000;"]], "1", "1"],
        ["50000", [6], "", -5, [["expression", "coinGain=50000;"]], "1", "1"],
        ["Exit", [8], "", 0, [["expression", ""]], "1", "1"]
    ];

    showCommandingMenu "#USER:EAT_coinChange";
    waitUntil{(commandingMenu == "")};
    if((coinGain == -1)) exitWith {};

    if(_addOrRemove == "remove") then {
        coinGain = coinGain - (coinGain * 2);
    };

    _target setVariable[Z_MoneyVariable, _Z_MoneyVariable + coinGain, true];
    cutText [format["%1 coin has been added (total: %2) for player %3", coinGain, _Z_MoneyVariable + coinGain, name _target],"PLAIN DOWN"]; titleFadeOut 10;

    // Tool use logger
    if(EAT_logMinorTool) then {
        EAT_PVEH_usageLogger = format["%1 %2 -- has added %3 to %4's coin (total %5)",name _player,getPlayerUID _player,coinGain,name _target,_Z_MoneyVariable + coinGain];
        [] spawn {publicVariable "EAT_PVEH_usageLogger";};
    };
}else{
    coinGain = _Z_MoneyVariable - (_Z_MoneyVariable * 2);
    _target setVariable[Z_MoneyVariable, 0, true];
    cutText [format["Coin reset to 0 for player %1", name _target],"PLAIN DOWN"]; titleFadeOut 10;

    // Tool use logger
    if(EAT_logMinorTool) then {
        EAT_PVEH_usageLogger = format["%1 %2 -- has RESET %3's coin to 0",name _player,getPlayerUID _player,name _target];
        [] spawn {publicVariable "EAT_PVEH_usageLogger";};
    };
};

7) Save and close the file.

8) Start the server.

Surely the most mindful will have realized that I have not simply duplicated the management of humanity by adapting it to coin. :)

I hope to have done what you like and above all to have been useful.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Discord

×
×
  • Create New...