Jump to content

InfiStar Coins menu in 1061


DAKA

Recommended Posts

Salival has a version of this working. I am unable to get this to work. His is much more simplified. This is the one that I have on my 1051 server

How would I convert this to 1061. 1051 and 1061 still use cashMoney to call the money, but uses PVAH_WriteLogReg, I think this has changed in the new version, what would I change this too? or if someone has this version working, please let me know.

Link to comment
Share on other sites

I am so damn stupid I forgot to select my char to add those things, no wonder it didnt work. working fine now. but I have tone of error in my local AO2 RPT, I will have to show Sal or you can look if you want oldmatechog

 

Link to comment
Share on other sites

I wondering if you could just check this, to make sure I did it right, please.

Spoiler

            adminadd = adminadd + ["  Change Tacos",changeCoins,"0","0","0","1",[0,0.8,1,1]];
            adminadd = adminadd + ["  Give 1,000 Tacos",adminCoinsPlus,"0","0","0","1",[0,1,0,1]];
            adminadd = adminadd + ["  Remove 1,000 Tacos",adminCoinsMinus,"0","0","0","1",[0.9,0,0,1]];
            adminadd = adminadd + ["  Give 5,000 Tacos",adminCoinsPlus1,"0","0","0","1",[0,1,0,1]];
            adminadd = adminadd + ["  Remove 5,000 Tacos",adminCoinsMinus1,"0","0","0","1",[0.9,0,0,1]];
            adminadd = adminadd + ["  Give 10,000 Tacos",adminCoinsPlus2,"0","0","0","1",[0,1,0,1]];
            adminadd = adminadd + ["  Remove 10,000 Tacos",adminCoinsMinus2,"0","0","0","1",[0.9,0,0,1]];
            adminadd = adminadd + ["  Give 15,000 Tacos",adminCoinsPlus3,"0","0","0","1",[0,1,0,1]];
            adminadd = adminadd + ["  Remove 15,000 Tacos",adminCoinsMinus3,"0","0","0","1",[0.9,0,0,1]];

Spoiler

    adminCoinsPlus1 =    {
        {
            if (name _x == _this select 0) then {
                _coins = _x getVariable[Z_moneyVariable,0];
                _x setVariable[Z_moneyVariable,_coins + 5000,true];
                hint format['Gave %1 +2500 %2!',_this select 0,CurrencyName];
                
                _sl = format['%1 plus 2500 %3 to %2',name player,_this select 0,CurrencyName];
                PVAH_WriteLogReq = [player,toArray _sl];
                publicVariableServer 'PVAH_WriteLogReq';
            };
        } forEach playableUnits;
    };
    adminCoinsMinus1 = {
        {
            if (name _x == _this select 0) then {
                _coins = _x getVariable[Z_moneyVariable,0];
                _x setVariable[Z_moneyVariable,_coins - 5000,true];
                hint format['Gave %1 -2500 %2!',_this select 0,CurrencyName];
                
                _sl = format['%1 minus 2500 %3 to %2',name player,_this select 0,CurrencyName];
                PVAH_WriteLogReq = [player,toArray _sl];
                publicVariableServer 'PVAH_WriteLogReq';
            };
        } forEach playableUnits;
    };
    adminCoinsPlus2 =    {
        {
            if (name _x == _this select 0) then {
                _coins = _x getVariable[Z_moneyVariable,0];
                _x setVariable[Z_moneyVariable,_coins + 10000,true];
                hint format['Gave %1 +2500 %2!',_this select 0,CurrencyName];
                
                _sl = format['%1 plus 2500 %3 to %2',name player,_this select 0,CurrencyName];
                PVAH_WriteLogReq = [player,toArray _sl];
                publicVariableServer 'PVAH_WriteLogReq';
            };
        } forEach playableUnits;
    };
    adminCoinsMinus2 = {
        {
            if (name _x == _this select 0) then {
                _coins = _x getVariable[Z_moneyVariable,0];
                _x setVariable[Z_moneyVariable,_coins - 10000,true];
                hint format['Gave %1 -2500 %2!',_this select 0,CurrencyName];
                
                _sl = format['%1 minus 2500 %3 to %2',name player,_this select 0,CurrencyName];
                PVAH_WriteLogReq = [player,toArray _sl];
                publicVariableServer 'PVAH_WriteLogReq';
            };
        } forEach playableUnits;
    };
    adminCoinsPlus3 =    {
        {
            if (name _x == _this select 0) then {
                _coins = _x getVariable[Z_moneyVariable,0];
                _x setVariable[Z_moneyVariable,_coins + 15000,true];
                hint format['Gave %1 +2500 %2!',_this select 0,CurrencyName];
                
                _sl = format['%1 plus 2500 %3 to %2',name player,_this select 0,CurrencyName];
                PVAH_WriteLogReq = [player,toArray _sl];
                publicVariableServer 'PVAH_WriteLogReq';
            };
        } forEach playableUnits;
    };
    adminCoinsMinus3 = {
        {
            if (name _x == _this select 0) then {
                _coins = _x getVariable[Z_moneyVariable,0];
                _x setVariable[Z_moneyVariable,_coins - 15000,true];
                hint format['Gave %1 -2500 %2!',_this select 0,CurrencyName];
                
                _sl = format['%1 minus 2500 %3 to %2',name player,_this select 0,CurrencyName];
                PVAH_WriteLogReq = [player,toArray _sl];
                publicVariableServer 'PVAH_WriteLogReq';
            };
        } forEach playableUnits;
    };
    adminCoinsPlus4 =    {
        {
            if (name _x == _this select 0) then {
                _coins = _x getVariable[Z_moneyVariable,0];
                _x setVariable[Z_moneyVariable,_coins + 25000,true];
                hint format['Gave %1 +2500 %2!',_this select 0,CurrencyName];
                
                _sl = format['%1 plus 2500 %3 to %2',name player,_this select 0,CurrencyName];
                PVAH_WriteLogReq = [player,toArray _sl];
                publicVariableServer 'PVAH_WriteLogReq';
            };
        } forEach playableUnits;
    };
    adminCoinsMinus4 = {
        {
            if (name _x == _this select 0) then {
                _coins = _x getVariable[Z_moneyVariable,0];
                _x setVariable[Z_moneyVariable,_coins - 25000,true];
                hint format['Gave %1 -2500 %2!',_this select 0,CurrencyName];
                
                _sl = format['%1 minus 2500 %3 to %2',name player,_this select 0,CurrencyName];
                PVAH_WriteLogReq = [player,toArray _sl];
                publicVariableServer 'PVAH_WriteLogReq';
            };
        } forEach playableUnits;
    };
    adminCoinsPlus5 =    {
        {
            if (name _x == _this select 0) then {
                _coins = _x getVariable[Z_moneyVariable,0];
                _x setVariable[Z_moneyVariable,_coins + 50000,true];
                hint format['Gave %1 +2500 %2!',_this select 0,CurrencyName];
                
                _sl = format['%1 plus 2500 %3 to %2',name player,_this select 0,CurrencyName];
                PVAH_WriteLogReq = [player,toArray _sl];
                publicVariableServer 'PVAH_WriteLogReq';
            };
        } forEach playableUnits;
    };
    adminCoinsMinus5 = {
        {
            if (name _x == _this select 0) then {
                _coins = _x getVariable[Z_moneyVariable,0];
                _x setVariable[Z_moneyVariable,_coins - 50000,true];
                hint format['Gave %1 -2500 %2!',_this select 0,CurrencyName];
                
                _sl = format['%1 minus 2500 %3 to %2',name player,_this select 0,CurrencyName];
                PVAH_WriteLogReq = [player,toArray _sl];
                publicVariableServer 'PVAH_WriteLogReq';
            };
        } forEach playableUnits;
    };

 

Link to comment
Share on other sites

Also now add/remove bank coins.

Presumes youve already added @Salival  add coins parts.. Full credit to him for the code, I changed the variable to to the bank also.

Find in AT.sqf

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,1,0,1]];
adminadd = adminadd + ["  Remove 25,000 Coins",adminCoinsMinus,"0","0","0","1",[0.9,0,0,1]];

 

Add below for each admin level low, normal, super.

adminadd = adminadd + ["  Change Bank",changebank,"0","0","0","1",[0,0.8,1,1]];

 

Find

};
	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';
	};

 

Add below

changebank = {
		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;
		};
		
		_bankmoney = _plr getVariable["MoneySpecial",0];
		_plr setVariable["MoneySpecial",_bankmoney+_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';
	};

 Save and enjoy.

Link to comment
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
  • Discord

×
×
  • Create New...