Jump to content

(RELEASE) Loyalty reward system


auzgamer

Recommended Posts

  On 1/12/2016 at 2:48 AM, OmigaaaD said:

So i made some quick modifications to the script to check for safezones but i have not tried it yet, we're using Andre's Safezones

 

multiPlyWith = 1;
_i=0;

while {_i < 7} do
{
	if ( _i == 1) then 
	{
		if	(inSafeZone = true) exitWith {
				_msg2 = parseText format ["<t align='center' color='#FFFFFF' shadow='2' size='1.75'>Loyalty time reward!</t><br/><t align='center' color='#17FF41'>------------------------------</t><br/><t align='center' color='#FFFFFF'>%1 thank you for playing on THGz! You are in a Safezone! No reward this time!</t><t align='center' color='#40FF00'>$%2</t>"];
				hint _msg2;
		} else {
			_reward = (5000 * multiPlyWith);
			player setVariable ["cashMoney", ((player getVariable ["cashMoney", 0]) + _reward), true];
			_msg = parseText format ["<t align='center' color='#FFFFFF' shadow='2' size='1.75'>Loyalty time reward!</t><br/><t align='center' color='#17FF41'>------------------------------</t><br/><t align='center' color='#FFFFFF'>%1 thank you for playing on THGz! Your loyalty has been rewarded with: </t><t align='center' color='#40FF00'>$%2</t>", name player, _reward];
			hint _msg;
			multiPlyWith = multiPlyWith + 1;
			_i = 0;
		};
	};
	sleep 1800;
	_i = _i + 1;
};

 

Edit: Does not work, gonna redo it when im not as tired :P

Expand  

Did this work for anyone?

Link to comment
Share on other sites

I made a change for this nice script.

With this u can buy bonds from trader and get every 20min an amount of money. (is for Coins system)

1-create a sqf called licence.sqf and drop in custom\bonus\

  Reveal hidden contents

2-create a sqf called bonus.sqf and drop in custom\bonus\

  Reveal hidden contents

3-go at bottom of your fn_selfActions.sqf and paste

  Reveal hidden contents

*Now go to your game, in front of Black Market trader , use scroll menu to buy a license and once u have it, u can buy a bonus.

Link to comment
Share on other sites

  • 9 months later...

Reworked this script a bit with a big help from @salival. Safezone loyalty benefits removed (thinking maybe rewards could be halved or quartered instead), Different levels of the multiplier with humanity, standard currency variable. Thanks for making the script, and for the Safezone ideas in the thread.

 

  Quote

private ["_multiplyer","_i","_reward","_humanity","_serverName","_multiplierLoop"];

_serverName = "Skeleton"; //Edit this to your own server
_i = 0;
_multiplierLoop = 1;
_multiplier = 1;

while {_i <= 7} do {
    if (_i == 2) then {
        _humanity = player getVariable ["humanity",0];
        switch (true) do {
            //Friendly
            case (_humanity >= -5000 && _humanity <= 5000): {_multiplier = 1.0};
            //Bandit
            case (_humanity <= -5000): {_multiplier = 1.2};
            //Hero
            case (_humanity >= 5000): {_multiplier = 1.3};
            //Super Bandit
            case (_humanity <= -50000): {_multiplier = 1.5};
            //Super Hero
            case (_humanity >= 30000): {_multiplier = 1.8};
            //Ultra Bandit
            case (_humanity <= -100000): {_multiplier = 1.7};
            //Ultra Hero
            case (_humanity >= 60000): {_multiplier = 2};
        };

        if (isInTraderCity) then {
            format ["Loyalty time reward! %1 thank you for playing on %2! You are in a Safezone! No reward this time!",name player,_serverName] call dayz_rollingMessages;
        } else {
            _reward = (2500 * (_multiplier * _multiplierLoop));
            format ["Loyalty time reward! %1 thank you for playing on %2! Your loyalty has been rewarded with: %3 %4",name player,_serverName,_reward,currencyName]call dayz_rollingMessages;
            player setVariable [Z_moneyVariable,((player getVariable [Z_moneyVariable, 0]) + _reward),true];
            _multiplierLoop = _multiplierLoop + 1;
        };
        _i = 0;
    };
    uisleep 1800;
    _i = _i + 1;
};
 

Expand  

 

Link to comment
Share on other sites

  • 4 weeks later...
  On 6/20/2016 at 3:46 PM, juandayz said:

I made a change for this nice script.

With this u can buy bonds from trader and get every 20min an amount of money. (is for Coins system)

1-create a sqf called licence.sqf and drop in custom\bonus\

  Reveal hidden contents

2-create a sqf called bonus.sqf and drop in custom\bonus\

  Reveal hidden contents

3-go at bottom of your fn_selfActions.sqf and paste

  Reveal hidden contents

*Now go to your game, in front of Black Market trader , use scroll menu to buy a license and once u have it, u can buy a bonus.

Expand  

Worked?

 

My init not setting?

Do not you have to edit it?

@juandayz

Link to comment
Share on other sites

@harcosgoogle this was for 1.0.5.1 (my rewrite)  anyway should work.. but i guess you need change the way that the server ask/obtain the coins.  @salival tell me the code for it in his ZSC post.

 

here i find it:

if you want to add coins to a player:

_amount = 5000;
_wealth = player getVariable[Z_MoneyVariable,0];
player setVariable[Z_MoneyVariable,(_wealth + _amount),true];

If you want to remove coins from a player:

_amount = 5000;
_wealth = player getVariable[Z_MoneyVariable,0];
player setVariable[Z_MoneyVariable,(_wealth - _amount),true];
Link to comment
Share on other sites

here you got an example

license.sqf

  Reveal hidden contents

 

Link to comment
Share on other sites

  • 3 weeks later...

Got bored decided to have a play with this, figured I'd share :D

Easy Config Options.
Humanity Based.
Notify player of their current and next reward level.
Players in safe-zones will not receive the reward.

 

f36fc6f906.png

 

1.0.6.1 Coins

  Reveal hidden contents

 

Link to comment
Share on other sites

  On 5/24/2017 at 3:06 PM, oldmatechoc said:

Got bored decided to have a play with this, figured I'd share :D

Easy Config Options.
Humanity Based.
Notify player of their current and next reward level.
Players in safe-zones will not receive the reward.

 

f36fc6f906.png

 

1.0.6.1 Coins

  Reveal hidden contents

how can i add it on server?

Expand  

 

Link to comment
Share on other sites

  On 5/28/2017 at 10:08 AM, oldmatechoc said:

same install as 1051 call it in your init.sqf

eg

https://github.com/EpochModTeam/DayZ-Epoch/blob/9fc72a8b875ed768851ba70e631cd93ee99afc0b/Server Files/MPMissions/DayZ_Epoch_11.Chernarus/init.sqf#L142

on a new line

execVM "PATH\TO\YOUR\player_rewards.sqf";

 

if (isServer) then {

code...

code....

execVM "Custom\player_rewards.sqf"

};

Expand  
  Reveal hidden contents

 

Link to comment
Share on other sites

  On 5/28/2017 at 10:14 AM, Ghostman said:
  Reveal hidden contents

 

Expand  

Should not be run on the server, this script is client side only

Link to comment
Share on other sites

  On 5/28/2017 at 10:20 AM, salival said:

Should not be run on the server, this script is client side only

Expand  

new error reward added but.

  Reveal hidden contents

 

Link to comment
Share on other sites

  On 5/28/2017 at 10:25 AM, Ghostman said:

new error reward added but.

  Reveal hidden contents

 

Expand  

I just tested this script and it works fine for me. I would guess that somehow it can't get your humanity.

In which case, put this code:

_mply = 1.0;

after this line:

_hmnty = player getVariable ["humanity",0];

 

Link to comment
Share on other sites

  On 5/28/2017 at 11:06 AM, salival said:

I just tested this script and it works fine for me. I would guess that somehow it can't get your humanity.

In which case, put this code:

_mply = 1.0;

after this line:

_hmnty = player getVariable ["humanity",0];

 

Expand  

sorry my bad i had

execVM "Custom\player_rewards.sqf"

should be

execVM "Custom\player_rewards.sqf";

can you tell me why bedug shows 0 humanity?
 

521CFE42D5D2EC981FAB23FC2463351D704FE8E3

Link to comment
Share on other sites

  • 1 month later...
  On 1/12/2016 at 2:48 AM, OmigaaaD said:

So i made some quick modifications to the script to check for safezones but i have not tried it yet, we're using Andre's Safezones

 

multiPlyWith = 1;
_i=0;

while {_i < 7} do
{
	if ( _i == 1) then 
	{
		if	(inSafeZone = true) exitWith {
				_msg2 = parseText format ["<t align='center' color='#FFFFFF' shadow='2' size='1.75'>Loyalty time reward!</t><br/><t align='center' color='#17FF41'>------------------------------</t><br/><t align='center' color='#FFFFFF'>%1 thank you for playing on THGz! You are in a Safezone! No reward this time!</t><t align='center' color='#40FF00'>$%2</t>"];
				hint _msg2;
		} else {
			_reward = (5000 * multiPlyWith);
			player setVariable ["cashMoney", ((player getVariable ["cashMoney", 0]) + _reward), true];
			_msg = parseText format ["<t align='center' color='#FFFFFF' shadow='2' size='1.75'>Loyalty time reward!</t><br/><t align='center' color='#17FF41'>------------------------------</t><br/><t align='center' color='#FFFFFF'>%1 thank you for playing on THGz! Your loyalty has been rewarded with: </t><t align='center' color='#40FF00'>$%2</t>", name player, _reward];
			hint _msg;
			multiPlyWith = multiPlyWith + 1;
			_i = 0;
		};
	};
	sleep 1800;
	_i = _i + 1;
};

 

Edit: Does not work, gonna redo it when im not as tired :P

Expand  

Did you ever get that to work man?

Link to comment
Share on other sites

22:20:35 "Survivor Rewards Log: Started!"
22:20:35 Error in expression <                                                    

switch (true) do {
case (_hmnty >= -5000 && _hmnty <= 5000): {_mp>
22:20:35   Error position: <_hmnty >= -5000 && _hmnty <= 5000): {_mp>
22:20:35   Error Undefined variable in expression: _hmnty
22:20:35 File mpmissions\__cur_mp.Napf\player_rewards.sqf, line 14
22:20:35 Error in expression <0):    {_mply = 1.9};                                                
};

if  (_hmnty >= -5000 &&     _hmnty <= 5000) then>
22:20:35   Error position: <_hmnty >= -5000 &&     _hmnty <= 5000) then>
22:20:35   Error Undefined variable in expression: _hmnty
22:20:35 File mpmissions\__cur_mp.Napf\player_rewards.sqf, line 29

Link to comment
Share on other sites

  On 7/9/2017 at 8:27 PM, harcosgoogle said:

22:20:35 "Survivor Rewards Log: Started!"
22:20:35 Error in expression <                                                    

switch (true) do {
case (_hmnty >= -5000 && _hmnty <= 5000): {_mp>
22:20:35   Error position: <_hmnty >= -5000 && _hmnty <= 5000): {_mp>
22:20:35   Error Undefined variable in expression: _hmnty
22:20:35 File mpmissions\__cur_mp.Napf\player_rewards.sqf, line 14
22:20:35 Error in expression <0):    {_mply = 1.9};                                                
};

if  (_hmnty >= -5000 &&     _hmnty <= 5000) then>
22:20:35   Error position: <_hmnty >= -5000 &&     _hmnty <= 5000) then>
22:20:35   Error Undefined variable in expression: _hmnty
22:20:35 File mpmissions\__cur_mp.Napf\player_rewards.sqf, line 29

Expand  

 

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
×
×
  • Create New...