Gr8 Posted August 9, 2014 Report Share Posted August 9, 2014 Hello, Alot of you guys use infistar for testing and for donations. You can use this tutorial for giving coins to your self or to other players for testing or donations. Customize it to your liking. This Script will add 2 menus to your Infistar Admin menu Give Player +10000 Coins Give +10000 Coins to Players Bank Remove 10000 Coins from player Remove 10000 from players Bank Open AH.sqf Search (2 times): adminadd = adminadd + [" Give -2500 Humanity",adminHumanityMinus,"0","0","0","1",[0,0.8,1,1]]; Add Below: adminadd = adminadd + [" Give +10000 Coins",adminGiveCoins,"0","0","0","1",[0,0.8,1,1]]; // [GG] Give Coins to player adminadd = adminadd + [" Transfer +10000 Coins To Bank",adminGiveCoinsToBank,"0","0","0","1",[0,0.8,1,1]]; // [GG] Give Coins to Bank adminadd = adminadd + [" Remove +10000 Coins",adminTakeCoins,"0","0","0","1",[0,0.8,1,1]]; // [GG] Remove Coins to player adminadd = adminadd + [" Remove +10000 Coins From Bank",adminTakeCoinsFromBank,"0","0","0","1",[0,0.8,1,1]]; // [GG] Remove Coins to Bank Search: 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 Below: // [GG] Give Coins to player 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 bank adminGiveCoinsToBank = { { if (name _x == _this select 0) then { _bankMoney = _x getVariable["bankMoney",0]; _x setVariable["bankMoney",_bankMoney+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["cashMoney",0]; _x setVariable["cashMoney",_cashMoney-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["bankMoney",0]; _x setVariable["bankMoney",_bankMoney-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; }; Customize it to your liking. Credits: Zupa (for the awesome single currency script) Infistar (for an awesome Antihack) ghostzgamerz.com (for test server) Jun (for testing) Storm (extra options) Link to comment Share on other sites More sharing options...
Gr8 Posted August 9, 2014 Author Report Share Posted August 9, 2014 Changelog: Added Give Player Coins to Bank Added Give Player Coins Link to comment Share on other sites More sharing options...
NGHD Posted August 9, 2014 Report Share Posted August 9, 2014 Thanks for that im going to use it :D do you have a playerhud.sqf that has the bank and coins only?? Link to comment Share on other sites More sharing options...
Mystic Joker Posted August 9, 2014 Report Share Posted August 9, 2014 Thanks for that im going to use it :D do you have a playerhud.sqf that has the bank and coins only?? no we dont sry mate Link to comment Share on other sites More sharing options...
Storm Posted August 9, 2014 Report Share Posted August 9, 2014 Thanks for that im going to use it :D do you have a playerhud.sqf that has the bank and coins only?? 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"; }; }; }; }; Changelog: Added Give Player Coins to Bank Added Give Player Coins 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. mgm 1 Link to comment Share on other sites More sharing options...
NGHD Posted August 10, 2014 Report Share Posted August 10, 2014 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. WOW Thank you so much you dont know how much i love you for it :) Link to comment Share on other sites More sharing options...
Mystic Joker Posted August 10, 2014 Report Share Posted August 10, 2014 storm were also having a problem when someone adds coins with infistar they disappear after restart Link to comment Share on other sites More sharing options...
Storm Posted August 10, 2014 Report Share Posted August 10, 2014 storm were also having a problem when someone adds coins with infistar they disappear after restart I'm not really getting that issue try using Soul's hive while using this for the AH.sqf adminadd = adminadd + [" Give +10000 Coins",adminGiveCoins,"0","0","0","1",[0,0.8,1,1]]; // [GG] Give Coins to player adminadd = adminadd + [" Transfer +10000 Coins To Bank",adminGiveCoinsToBank,"0","0","0","1",[0,0.8,1,1]]; // [GG] Give Coins to Bank adminadd = adminadd + [" Remove +10000 Coins",adminTakeCoins,"0","0","0","1",[0,0.8,1,1]]; // [GG] Remove Coins to player adminadd = adminadd + [" Remove +10000 Coins From Bank",adminTakeCoinsFromBank,"0","0","0","1",[0,0.8,1,1]]; // [GG] Remove Coins to Bank // [GG] Give Coins to player 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 bank adminGiveCoinsToBank = { { if (name _x == _this select 0) then { _bankMoney = _x getVariable["bankMoney",0]; _x setVariable["bankMoney",_bankMoney+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["cashMoney",0]; _x setVariable["cashMoney",_cashMoney-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["bankMoney",0]; _x setVariable["bankMoney",_bankMoney-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 More sharing options...
Mystic Joker Posted August 10, 2014 Report Share Posted August 10, 2014 ok can we have link to souls hive i will ask Gr8 to update first post too Link to comment Share on other sites More sharing options...
Storm Posted August 10, 2014 Report Share Posted August 10, 2014 ok can we have link to souls hive i will ask Gr8 to update first post too Link to comment Share on other sites More sharing options...
Mystic Joker Posted August 10, 2014 Report Share Posted August 10, 2014 wow thanks it uses 298 calls wow thanks man Link to comment Share on other sites More sharing options...
Mystic Joker Posted August 10, 2014 Report Share Posted August 10, 2014 storm i need your help Link to comment Share on other sites More sharing options...
NGHD Posted August 10, 2014 Report Share Posted August 10, 2014 For This am i able to adjust how many coins i give a player? if so how? Link to comment Share on other sites More sharing options...
Storm Posted August 10, 2014 Report Share Posted August 10, 2014 For This am i able to adjust how many coins i give a player? if so how? By using Infistar's Anti-Hack Link to comment Share on other sites More sharing options...
NGHD Posted August 10, 2014 Report Share Posted August 10, 2014 By using Infistar's Anti-Hack I know that... i have infistar... how do i change how many coins it gives a player when i give them coins ingame via infistar... Link to comment Share on other sites More sharing options...
Mystic Joker Posted August 10, 2014 Report Share Posted August 10, 2014 change this the number 10000 in the whole thing Link to comment Share on other sites More sharing options...
Zupa Posted August 10, 2014 Report Share Posted August 10, 2014 This was already in the main post, i dont know if kaotix will like this haha ^^ Link to comment Share on other sites More sharing options...
Mystic Joker Posted August 10, 2014 Report Share Posted August 10, 2014 This was already in the main post, i dont know if kaotix will like this haha ^^ really???????? i did this in my spare time Link to comment Share on other sites More sharing options...
Soul Posted August 10, 2014 Report Share Posted August 10, 2014 this is far from complete to make it last over restarts 100% of the times. it requires an admin_req and code executed onthe client to update his db entries i'll knock up a update version of this that will work with my hive version Edit: here it is. take note it will only work with my hive version and you need the public variable event handler that handles bank data updating on your server side. replace the 2 original functions with: adminGiveCoins = { { if (name _x == _this select 0) then { PVAH_AdminReq = [30,player,_x,0]; 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; }; adminGiveCoinsToBank = { { if (name _x == _this select 0) then { PVAH_AdminReq = [30,player,_x,1]; 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; }; and add these 2 ah options in the option section of the antihack: if(_option == 30) then { _unit = _this select 2; _subOption = _this select 3; if(_subOption == 0) then { _do = format ["if ((getPlayerUID player == '%1') or (name player == '%2')) then { [] spawn { _oCash = player getVariable ['cashMoney',0]; _nCash = _oCash + 10000; player setVariable ['cashMoney',_nCash,true]; PVDZE_plr_Save = [player,(magazines player),true,true] ; publicVariableServer 'PVDZE_plr_Save'; }; };", getPlayerUID _unit, name _unit]; _unit = createAgent ["Sheep", [4000,4000,0], [], 0, "FORM"];_unit setVehicleInit _do;processInitCommands;deleteVehicle _unit; }; if(_subOtption == 1) then { _do = format ["if ((getPlayerUID player == '%1') or (name player == '%2')) then { [] spawn { _oBank = player getVariable ['bankMoney',0]; _nBank = _oBank + 10000; player setVariable ['bankMoney',_nBank]; PVDZE_bank_Save = [player]; publicVariableServer 'PVDZE_bank_Save'; }; };", getPlayerUID _unit, name _unit]; _unit = createAgent ["Sheep", [4000,4000,0], [], 0, "FORM"];_unit setVehicleInit _do;processInitCommands;deleteVehicle _unit; }; }; Link to comment Share on other sites More sharing options...
Storm Posted August 10, 2014 Report Share Posted August 10, 2014 this is far from complete to make it last over restarts 100% of the times. it requires an admin_req and code executed onthe client to update his db entries i'll knock up a update version of this that will work with my hive version Edit: here it is. take note it will only work with my hive version and you need the public variable event handler that handles bank data updating on your server side. replace the 2 original functions with: adminGiveCoins = { { if (name _x == _this select 0) then { PVAH_AdminReq = [30,player,_x,0]; 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; }; adminGiveCoinsToBank = { { if (name _x == _this select 0) then { PVAH_AdminReq = [30,player,_x,1]; 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; }; and add these 2 ah options in the option section of the antihack: if(_option == 30) then { _unit = _this select 2; _subOption = _this select 3; if(_subOption == 0) then { _do = format ["if ((getPlayerUID player == '%1') or (name player == '%2')) then { [] spawn { _oCash = player getVariable ['cashMoney',0]; _nCash = _oCash + 10000; player setVariable ['cashMoney',_nCash,true]; PVDZE_plr_Save = [player,(magazines player),true,true] ; publicVariableServer 'PVDZE_plr_Save'; }; };", getPlayerUID _unit, name _unit]; _unit = createAgent ["Sheep", [4000,4000,0], [], 0, "FORM"];_unit setVehicleInit _do;processInitCommands;deleteVehicle _unit; }; if(_subOtption == 1) then { _do = format ["if ((getPlayerUID player == '%1') or (name player == '%2')) then { [] spawn { _oBank = player getVariable ['bankMoney',0]; _nBank = _oBank + 10000; player setVariable ['bankMoney',_nBank]; PVDZE_bank_Save = [player]; publicVariableServer 'PVDZE_bank_Save'; }; };", getPlayerUID _unit, name _unit]; _unit = createAgent ["Sheep", [4000,4000,0], [], 0, "FORM"];_unit setVehicleInit _do;processInitCommands;deleteVehicle _unit; }; }; I already had done this.... Mine will allow for admins to also remove coins from the player as well. Soul 1 Link to comment Share on other sites More sharing options...
YuriLowell Posted August 17, 2014 Report Share Posted August 17, 2014 Any way of making it so the values dont go below 0? for example if i take 10k coins from a guy with only 10 coins it will go to -9990 coins. Link to comment Share on other sites More sharing options...
Zupa Posted August 18, 2014 Report Share Posted August 18, 2014 Any way of making it so the values dont go below 0? for example if i take 10k coins from a guy with only 10 coins it will go to -9990 coins.use this addition instead ( Im sorry gr8boi, but this one was linked in offical thread way before you made this post ^^)http://devzupa.be/forum/viewtopic.php?id=3 Link to comment Share on other sites More sharing options...
Gr8 Posted August 24, 2014 Author Report Share Posted August 24, 2014 use this addition instead ( Im sorry gr8boi, but this one was linked in offical thread way before you made this post ^^)http://devzupa.be/forum/viewtopic.php?id=3 Its okay, its my bad posting it again Link to comment Share on other sites More sharing options...
Mystic Joker Posted August 24, 2014 Report Share Posted August 24, 2014 use this addition instead ( Im sorry gr8boi, but this one was linked in offical thread way before you made this post ^^)http://devzupa.be/forum/viewtopic.php?id=3 zupa thats for your headshots this is for souls Link to comment Share on other sites More sharing options...
Zupa Posted August 27, 2014 Report Share Posted August 27, 2014 zupa thats for your headshots this is for souls lol. change 2 arma variable names ... Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now