Jump to content

[Tutorial] Give Coins to player - Using Infistar


Recommended Posts

I do.

I already released it in the project thread.

 

playerhud.sqf

disableSerialization;

// player setVariable["AsReMixhud", true];//Variable Show/Hide HUD Support for control player hud

AsReMixhud_Control = true; // player getVariable["AsReMixhud",true];


while {true} do
{
    1000 cutRsc ["AsReMixhud","PLAIN"];
    _wpui = uiNameSpace getVariable "AsReMixhud";
    _vitals = _wpui displayCtrl 4900;
	
	_thePlayer = player;
	AsReMixhud_headshots 		= _thePlayer getVariable["headShots",0];
    Zupa_bank 		=  _thePlayer getVariable["bank",0];
	
    

	//if(AsReMixhud_humanity >= 5000) then { AsReMixhud_hmnicon = "<img size='0.8' image='addons\playerhud\icons\As_hmhero.paa'/>"; };
	//if((AsReMixhud_humanity >= 200) && (AsReMixhud_humanity <= 4999)) then { AsReMixhud_hmnicon = "<img size='0.8' image='addons\playerhud\icons\As_hmcivil.paa'/>"; };
//	if(AsReMixhud_humanity <= 199) then { AsReMixhud_hmnicon = "<img size='0.8' image='addons\playerhud\icons\As_hmbandit.paa'/>"; };
	
	_vitals ctrlSetStructuredText parseText format ["
		<t size='0.9'> %1 </t><img size='0.8' align='right' image='addons\playerhud\icons\dollars.paa'/>   <br/>",
	[AsReMixhud_headshots] call BIS_fnc_numberText,//1
	Zupa_bank//2
	];
	_vitals ctrlCommit 0;
        
    sleep 2;
};

 

hud.hpp

/*
	AsReMix Player HUD File - Zupa Single Currency Edit - Lots of thanks to AsRemix.
*/

#define hud_status_idc 4900


class AsReMixhud {
	idd = -1;
    fadeout=0;
    fadein=0;
	duration = 20;
	name= "AsReMixhud";
	onLoad = "uiNamespace setVariable ['AsReMixhud', _this select 0]";
	
	class controlsBackground {

		class AsReMixhud_Status:Hw_RscText
		{
			idc = hud_status_idc;
			type = CT_STRUCTURED_TEXT;
			size = 0.040;
    x = safezoneX + (safezoneW -0.365) ;
	y = safezoneY + 0.465 * safezoneW;
			w = 0.35; h = 0.35;
			colorText[] = {1,1,1,1};
			lineSpacing = 3;
			colorBackground[] = {0,0,0,0};
			text = "";
			shadow = 2;
			class Attributes {
				align = "right";
			};
		};

	};
};
 

 

 
 

Also I did a quite of few customization to it and made it so that its possible to remove coins and made it work with Soul's custom hive as well.

How Would The PlayerHud.sqf be set up with Souls Hive?

Link to comment
Share on other sites

  • 1 year later...

how do i make it so i can spawn 10k 100k and 500k every time i do this it spawns in 500k on each button i have the changed like this below

 

adminadd = adminadd + ["  Give +1000 Coins",adminGiveCoins,"0","0","0","1",[0,0.8,1,1]]; // [GG] Give Coins to player
adminadd = adminadd + ["  Give +10000 Coins",adminGiveCoins,"0","0","0","1",[0,0.8,1,1]]; // [GG] Give Coins to player
adminadd = adminadd + ["  Give +500000 Coins",adminGiveCoins,"0","0","0","1",[0,0.8,1,1]]; // [GG] Give Coins to player

 

 

// [GG] Give Coins to player 10k
    adminGiveCoins =
    {
        {
            if (name _x == _this select 0) then
            {
                _cashMoney = _x getVariable["cashMoney",0];
                _x setVariable["cashMoney",_cashMoney+1000,true];
                hint format ["Gave %1 +1000 Coins!",_this select 0];
                
                _sl = format["%1 plus 1000 Coins to %2",name player,_this select 0];
                PVAH_WriteLogReq = [player,_sl];
                publicVariableServer "PVAH_WriteLogReq";
            };
        } forEach playableUnits;
    };
    // [GG] Give Coins to player 100k
    adminGiveCoins =
    {
        {
            if (name _x == _this select 0) then
            {
                _cashMoney = _x getVariable["cashMoney",0];
                _x setVariable["cashMoney",_cashMoney+10000,true];
                hint format ["Gave %1 +10000 Coins!",_this select 0];
                
                _sl = format["%1 plus 10000 Coins to %2",name player,_this select 0];
                PVAH_WriteLogReq = [player,_sl];
                publicVariableServer "PVAH_WriteLogReq";
            };
        } forEach playableUnits;
    };
    // [GG] Give Coins to player 500k
    adminGiveCoins =
    {
        {
            if (name _x == _this select 0) then
            {
                _cashMoney = _x getVariable["cashMoney",0];
                _x setVariable["cashMoney",_cashMoney+500000,true];
                hint format ["Gave %1 +500000 Coins!",_this select 0];
                
                _sl = format["%1 plus 500000 Coins to %2",name player,_this select 0];
                PVAH_WriteLogReq = [player,_sl];
                publicVariableServer "PVAH_WriteLogReq";
            };
        } forEach playableUnits;
    };

Link to comment
Share on other sites

  • 1 year later...
51 minutes ago, Zyxed1 said:

Not working for me. I have the options to give/remove coins and if i try it out it just doesn't work. Any help?

Which version of epoch are you using. 1051 or 106?  If im not mistaken, this is for 1051 and might not work with 106.

Chris will most likely implement the coins once a mod has been released to the public..or if its released...

Link to comment
Share on other sites

2 hours ago, Zyxed1 said:

999 hive version 1.1

pretty sure the variable for the money is different. This one is made for souls 2.0. The variable is _cashmoney. Yours, if im not mistaken is _headshots.

Someone else might be able to clear that up for me, but you need to change the all the variables in this script to use yours.

Link to comment
Share on other sites

I changed the variables to _headshot and now it removes all of my money

 // [GG] Give Coins to player
adminGiveCoins =
    {
        {
            if (name _x == _this select 0) then
            {
                _cashMoney = _x getVariable["headShots",0];
                _x setVariable["headShots",_headShots+10000,true];
                hint format ["Gave %1 +10000 Coins!",_this select 0];
                
                _sl = format["%1 plus 10000 Coins to %2",name player,_this select 0];
                PVAH_WriteLogReq = [player,_sl];
                publicVariableServer "PVAH_WriteLogReq";
            };
        } forEach playableUnits;
    };

// [GG] give Coins to bank
adminGiveCoinsToBank =
    {
        {
            if (name _x == _this select 0) then
                {
                    _bankMoney = _x getVariable["bank",0];
                    _x setVariable["bank",_bank+10000,true];
                    hint format ["Gave %1 +10000 Coins!",_this select 0];
                                     
                    _sl = format["%1 plus 10000 Coins to %2",name player,_this select 0];
                    PVAH_WriteLogReq = [player,_sl];
                    publicVariableServer "PVAH_WriteLogReq";
                };
        } forEach playableUnits;
    };
       // [GG] Remove Coins From player
    adminTakeCoins =
    {
        {
            if (name _x == _this select 0) then
            {
                _cashMoney = _x getVariable["headShots",0];
                _x setVariable["headShots",_headShots-10000,true];
                hint format ["Removed %1 +10000 Coins!",_this select 0];
                
                _sl = format["%1 minus 10000 Coins from %2",name player,_this select 0];
                PVAH_WriteLogReq = [player,_sl];
                publicVariableServer "PVAH_WriteLogReq";
            };
        } forEach playableUnits;
    };

    // [GG] Remove Coins From bank
    adminTakeCoinsFromBank =
    {
        {
            if (name _x == _this select 0) then
                {
                    _bankMoney = _x getVariable["bank",0];
                    _x setVariable["bank",_bank-10000,true];
                    hint format ["Removed %1 -10000 Coins!",_this select 0];
                                     
                    _sl = format["%1 minus 10000 Coins from %2",name player,_this select 0];
                    PVAH_WriteLogReq = [player,_sl];
                    publicVariableServer "PVAH_WriteLogReq";
                };
        } forEach playableUnits;
    };

 

Link to comment
Share on other sites

  • 2 years later...

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...