Jump to content
Cherdenko

[Release] Paycheck/Loyality Reward

Recommended Posts

Edit: Credit to @BigEgg for base script

 

Hello guys, today i came up  with a little script that gives players Money based on their time on the server.

there is a multiplicator included that gives you more money every time, until the 4th time is reached. this is the highest possible Tier

needs to be initialized with :

[] execVM "YOUR_PATH_TO\paycheck.sqf";

in the if (!isDedicated) Section in the init.sqf

Spoiler
/*
Original thread:
https://epochmod.com/forum/topic/44337-release-paycheckloyality-reward/
*/


private["_Ran", "_Amount", "_Delay","_Wallet","_multiplier","_posAlt","_posNew","_posDistance"];


_Amount =10000; // change to your liking
_Delay = 100; // change to your liking

// Do not change
_Ran = 0;
_multiplier = 1; 
// Do not change




while {_Ran < 2} do 
{

_Amount = _Amount*_multiplier;


    if (_Ran == 1) then {
	
	_posNew = getPos (vehicle player);
	_posDistance= round(_posAlt distance _posNew);
	if (_posDistance< 50) then {
	systemChat format["[Server-name]: You did not move %1 ... No reward to claim, Multiplicator reset", name player];
	_multiplier = 1;
	_Ran =0;
	
	}else{
		_Wallet = player getVariable[Z_MoneyVariable, 0];
        player setVariable[Z_MoneyVariable, _Wallet + _Amount, true];
        call player_forceSave;
        systemChat format["[Server-Name]: %1 - Pay Check Time %2 Coins! Thank you for playing on Server-Name! You are currently on Tier %3", name player, _Amount,_multiplier];
        _Ran = 0;
		
		if(_multiplier<4)then{
		_multiplier = _multiplier +1;
		};
		
	};
		
};
    _Ran = _Ran + 1;
	_posAlt = getPos (vehicle player);
    uiSleep _Delay;

};

 

Base Script without any multiplicator:
@NateDayZ there you go.
edited this on my smartphone so sry if it looks a bit bad

Spoiler


/*
Original thread:
https://epochmod.com/forum/topic/44337-release-paycheckloyality-reward/
*/


private["_Ran", "_Amount", "_Delay","_Wallet"];


_Amount =10000; // change to your liking
_Delay = ; // change to your liking

// Do not change
_Ran = 0;
// Do not change




while {_Ran < 2} do 
{



    if (_Ran == 1) then {
	
	
		_Wallet = player getVariable[Z_MoneyVariable, 0];
        player setVariable[Z_MoneyVariable, _Wallet + _Amount, true];
        call player_forceSave;
        systemChat format["[Server-Name]: %1 - Pay Check Time %2 Coins! Thank you for playing on Server-Name!", name player, _Amount];
        _Ran = 0;
		
		
	};
		

    _Ran = _Ran + 1;
	
    uiSleep _Delay;

};

 

original script by @BigEgg:

Spoiler
private["_Ran", "_Amount", "_Delay", "_nearestPlots", "_isNearPlot", "_udderWallet"];

_Ran = 0;
_Amount = 2500;
_Delay = 900;

while {_Ran < 2} do 
{
    if (_Ran == 1) then {
		if (isInTraderCity) exitWith {
            systemChat format["[UDDER-AH]: %1 - You cannot claim your reward if you are in a safezone!", name player];
            _Ran = 0;
        };
		_nearestPlots = vehicle player nearEntities["Plastic_Pole_EP1_DZ", DZE_PlotPole select 0];
		_isNearPlot = count(_nearestPlots);
        if (_isNearPlot > 0) exitWith {
            systemChat format["[UDDER-AH]: %1 - You cannot claim your reward if you are within %2m of a base!", name player, DZE_PlotPole select 0];
            _Ran = 0;
        };
		_udderWallet = player getVariable[Z_MoneyVariable, 0];
        player setVariable[Z_MoneyVariable, _udderWallet + _Amount, true];
        systemChat format["[UDDER-AH]: %1 - Your wallet has been credited with 2,500 Gold Coins! Thank you for playing on UDDER!", name player];
        _Ran = 0;
    };
    _Ran = _Ran + 1;
    uiSleep _Delay;
};

 

as allways have fun :)

Share this post


Link to post
Share on other sites
@NateDayZ there you go.
edited this on my smartphone so sry if it looks a bit bad

/*
Original thread:
https://epochmod.com/forum/topic/44337-release-paycheckloyality-reward/
*/


private["_Ran", "_Amount", "_Delay","_Wallet"];


_Amount =10000; // change to your liking
_Delay = ; // change to your liking

// Do not change
_Ran = 0;
// Do not change




while {_Ran < 2} do 
{



    if (_Ran == 1) then {
	
	
		_Wallet = player getVariable[Z_MoneyVariable, 0];
        player setVariable[Z_MoneyVariable, _Wallet + _Amount, true];
        call player_forceSave;
        systemChat format["[Server-Name]: %1 - Pay Check Time %2 Coins! Thank you for playing on Server-Name!", name player, _Amount];
        _Ran = 0;
		
		
	};
		

    _Ran = _Ran + 1;
	
    uiSleep _Delay;

};

Share this post


Link to post
Share on other sites

Be careful with these kinds of scripts, we had it in our server, and when we reached 40-50 players our loyalty script just crapped the bed, it gave players the amount of money "any" so they could withdraw and deposit infinite amounts of money, I am not saying this to discourage anyone but to encourage that someone makes a safeguard against it.

good work though!!!

Share this post


Link to post
Share on other sites

Jesus Christ, as if it couldn't get any better. If you are going to steal code out of my mission file, change a few lines and comments, and release it, at least give me some credits. This is even worse than the version I had in my mission file which checked if they were in a trader, or if they were near a base.

Share this post


Link to post
Share on other sites
private["_Ran", "_Amount", "_Delay", "_nearestPlots", "_isNearPlot", "_udderWallet"];

_Ran = 0;
_Amount = 2500;
_Delay = 900;

while {_Ran < 2} do 
{
    if (_Ran == 1) then {
		if (isInTraderCity) exitWith {
            systemChat format["[UDDER-AH]: %1 - You cannot claim your reward if you are in a safezone!", name player];
            _Ran = 0;
        };
		_nearestPlots = vehicle player nearEntities["Plastic_Pole_EP1_DZ", DZE_PlotPole select 0];
		_isNearPlot = count(_nearestPlots);
        if (_isNearPlot > 0) exitWith {
            systemChat format["[UDDER-AH]: %1 - You cannot claim your reward if you are within %2m of a base!", name player, DZE_PlotPole select 0];
            _Ran = 0;
        };
		_udderWallet = player getVariable[Z_MoneyVariable, 0];
        player setVariable[Z_MoneyVariable, _udderWallet + _Amount, true];
        systemChat format["[UDDER-AH]: %1 - Your wallet has been credited with 2,500 Gold Coins! Thank you for playing on UDDER!", name player];
        _Ran = 0;
    };
    _Ran = _Ran + 1;
    uiSleep _Delay;
};

Funny how similar it looks, am I right? While all you did is remove stuff, you didn't even change the variable names. It's a simple ass script, but at least give some credit.

 

EDIT: It also looks like you took it before I removed the player_forceSave call which was annoying my players.

Share this post


Link to post
Share on other sites

well first off i did not steal it from your server, ive never been on your server, as i just use european servers.
i did see that script a long time ago when a friend sent me that script for 1051,  and was figuring out how to do it in 1.0.6.1 +multiplicator so i didn't know if it was your code.

if it is indeed your code, then im sorry and will correctly give credit to you. @BigEgg

Share this post


Link to post
Share on other sites
2 minutes ago, Cherdenko said:

well first off i did not steal it from your server, ive never been on your server, as i just use european servers.
i did see that script a long time ago when a friend sent me that script for 1051,  and was figuring out how to do it in 1.0.6.1 +multiplicator so i didn't know if it was your code.

if it is indeed your code, then im sorry and will correctly give credit to you. @BigEgg

Thanks.

 

Who is your friend? I bet I know who it is, just curious ;)

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

  • Similar Content

    • By Mrjinkzy
      New W.I.C.K.E.D Gaming Overpoch
      W.I.C.K.E.D GAMING PVP /Building Box/bank/AI /Paycheck 
       
      172.106.174.6:2802 https://gyazo.com/8f1c739fe5b0b965db7f3f6df451efc9
    • By icomrade
      Hello all,
      We are pleased to announce the release of ArmA 2 DayZ Epoch 1.0.6, available for download at: http://epochmod.com/a2dayzepoch.php
      This release introduces the integration of some of the most common Epoch community modifications from prior epoch release, DayZ Mod 1.8.8, and a new group system that persists in the database.  Most of the highlights can be found in the change log below, which is fairly comprehensive, but by no means exhaustive.
      Please note that community addons/expansions for previous Epoch release WILL NOT work on Epoch 1.0.6, be sure to review the change log for which mods are now included. In addition, the loot table format has completely changed, you must base your loot table modifications on the new format, which can be found by evaluating the stock loot tables: https://github.com/EpochModTeam/DayZ-Epoch/tree/Release_1.0.6/SQF/dayz_code/Configs/CfgLoot
      1.0.5.1 and older Single Currency scripts are NOT compatible with 1.0.6, there is no included single currency script in this release. However, because we are so wonderful, we have chosen to integrate single currency saving to the DB, so a third-party HiveEXT is not necessary and the SQF is all that needs to be written/updated.
       
    • By vbawol
      Solar Generator / Energy capacity system:
      Solar Generator base item can be crafted from items found in the world. When placed gives passive power within (75m Default). Energy capacity system controls how much power is available based on the type of energy source and number of players in area. Personal solar generators have 10 charge rate at day and reduced charge capacity of 5 at night. Wind towers and large solar farms have 100 charge rate. Each player will equally share the energy charge capacity up to the max charge rate of 5 per tick. More solar generators can be built to increase total charge capacity for larger groups. Wood Towers
      Can be crafted using a Wood Floor Kit and 4x lumber. First test of the new building upgrade system gives you the ability to use 2x lumber to add a windowed wall to the side you are standing. Walls can be removed and refund one lumber pack. Wood Walls / Upgrade in Place
      New upgrade in place options and 4 new plywood walls Building upgrade system now supports multiple options and has new basic UI. Wood Ladder
      Can be crafted from 4x lumber. Base Building
      Removed base object "Move" in 3d option in favor of a more refined "ghost" snap mode. Can now disable base building by pressing Esc or 'gear' menu. Angle of snapping was incorrect when building on angles. Can now press '2' to disable building snap mode and 1 to re-enable. Normalized snap memory points for wood tower and stairs should make snapping more accurate Issue that caused shifting of some base objects after restart. Only maintain damaged objects and object health is repaired on maintain. Looting
      New loot/crafting items: (Solar Panels, Wire Cables, Battery Box). Air Drop loot has been Increased. Pumpkin harvesting on Chernarus should work, "Trash" loot now has separate configs. Antagonists
      Cultist's make a triumfant return, as cultist spawning is now fixed. Vehicles
      Fixed JetSki sinking like a rock.  
      Technical
      [Changed] Moved client gamemode and CfgFunctions init to mission file. [Changed] Base building upgrade recipes and remove payouts now have dedicated config "CfgBaseBuilding" and code supports over-loading via description.ext. [Changed] Server side database functions renamed and now use cfgFunctions via a new pbo "epoch_server_core". [Changed] Make use of new command getAllHitPointsDamage in A3 1.50 to increase performance of hitpoint data storage. [Changed] Use new A3 command setHitIndex instead of setHitPointDamage so we can use all hitpoints regardless of name. [Changed] Change BIS_fnc_distance2D usage over to distance2D command that was added with A3 1.50 for better performance. [Fixed] Loot code for "CfgBuildingLootPos" now uses EPOCH_returnConfig to allow over-loading via description.ext. [Fixed] Error in rpt "No geometry and no visual shape" with Poppy and Goldenseal plants models. [Fixed] CfgEpochClient missionConfigFile version check was incorrectly using configFile. [Fixed] Loot object "Blue Tarp" weaponholder proxy position was in the wrong position. [Fixed] Reduce base hunger/thirst loss rate by half if players stamina is above 100. Base rate now can be changed with "baseHTLoss" variable in CfgEpochClient. [Info] Requres Arma 3 1.50 or higher. [ServerInfo] CfgEpochClient removed from description.ext as it can be simply added again from our configs as needed. [ServerInfo] Removed old .bikey and added new one for 0330.  
      Server Admins see files that have changed here: https://github.com/EpochModTeam/Epoch/commit/24bcfafe60e0ea043700cf82a2e0b2f6d96e1bbd
       
    • By Jacen
      Description:
      This trader is completely pre-configured and well working. It goes along with Zupa's currency system which allows traders to trade for money, you may also use this on servers without currency by changing a simple line of code. The safe zone coordinates have been given, and everything's perfect. Have fun with the system and let me know what you think. The trader uses all traders except blackmarket and helicopter traders, there is no banker as I used the storage script with Zupa's system. There is a helicopter landing pad, a wide car-park. It also includes map markers, e.g the black markers on the map when searching for a trader. I hope you enjoy my work and I'll be releasing more soon!
       
      Image of the full trader:
      http://cloud-4.steamusercontent.com/ugc/37489965390073538/F3019F5D803021C13D9DD426C2B5E7C8DD94A60D/
       
      Not Sure!
      I wasn't sure if this was supposed to be placed in the Epoch Bases section, as it's also a tutorial for installing traders, it isn't just the base. So if this has been released in the wrong place, please make sure you let me know and I'll see if I can get it moved. Also, it would be really nice if you guys could drop a comment on the homepage of my website!
       
       

    • By AllenFromStacysmom
      2 Bandit WAI customized missions 
      --- Denny's Farm
      --- Troop's Supply
       
       
      Mission Plot:
      --- Denny is giving out some supplies at his farm.
      --- The local troop just received their supply.
       
      Screenshots:
      https://www.dropbox.com/sh/k9txqxw6q4qx71t/AADTvplz45CXdSrW8Pyo5W8Fa?dl=0
       
      Requirement:
      -PBO to pack mission file
      -WAI
       
      Installation:
      ---Download and install WAI to your server.pbo
      Link :   
      ---Create  farmer_give.sqf and troop_supply.sqf files in dayz_server\WAI\missions\bandits
      In farmer_give.sqf
      Copy and paste



      In troop_supply.sqf, copy and paste:



      ---Edit the config.sqf :
      find 
      wai_bandit_missions = [ ["armed_vehicle",10], ["black_hawk_crash",10], ["captured_mv22",10], ["broken_down_ural",10], ["hero_base",10], ["ikea_convoy",10], ["medi_camp",10], ["presidents_mansion",10], ["sniper_extraction",10], ["weapon_cache",10], ];  the missions you have may be different from me, and the number after the mission name is the chance of the mission will happen
      Example:  ["mission_name",chance in %]
      ---Add in farmer_give and troop_supply
      so it would look like this 
      wai_bandit_missions = [ ["armed_vehicle",10], ["black_hawk_crash",10], ["captured_mv22",10], ["broken_down_ural",10], ["hero_base",10], ["ikea_convoy",10], ["medi_camp",4], ["presidents_mansion",10], ["sniper_extraction",10], ["weapon_cache",4], ["farmer_give",6], ["troop_supply",6] ];   Make sure the number add up to 100. You can change the chance of the mission happen by change the number in % to whatever you want.
       
      Now you are done!
      Repack your server.pbo to try out the missions  :D
       
      Let me know if there is any problem with the mission.
  • Advertisement
  • Advertisement
  • Supporters
  • Advertisement
  • Discord

×