Jump to content

(RELEASE) Loyalty reward system


auzgamer

Recommended Posts

On 1/11/2016 at 9:48 PM, 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

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\

Spoiler

private ["_playerPos","_neartrader","_costs","_haslicence"];

call gear_ui_init;
_playerPos = getPosATL player;
_neartrader = count nearestObjects [_playerPos, ["GUE_Woodlander2"], 3] > 0;
_costs = 5000;
_haslicence = "ItemBook2" in magazines player;

if (_haslicence) exitWith {cutText [format["already have a licensee"], "PLAIN DOWN"];};

if (_neartrader) then {
    if !([ player,_costs] call SC_fnc_removeCoins) then {
        titleText [format["Needs%1 %2 to buy this license.",_costs,CurrencyName] , "PLAIN DOWN", 1];
    } else {
    titleText [format["bought %1  %2 %3",_costs,CurrencyName] , "PLAIN DOWN", 1];
    player addMagazine "ItemBook2";
    sleep 5;
            
  };    
};

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

Spoiler

private ["_playerPos","_nearbank","_costs","_hasbonus","_reward","_msg","_LastUsedTime","_Time"];

call gear_ui_init;
_playerPos = getPosATL player;
_nearbank = count nearestObjects [_playerPos, ["GUE_Woodlander2"], 3] > 0;
_costs = 5000;
_hasbonus = "ItemBook2" in magazines player;
_LastUsedTime = 3600;
_Time = time - lastlaunch;

if !(_hasbonus) exitWith {cutText [format["Need a license to buy a bonus"], "PLAIN DOWN"];};

 

 

if(_Time < _LastUsedTime) exitWith {
    cutText [format["already have a bonus wait %1 seconds !",(round(_Time - _LastUsedTime))], "PLAIN DOWN"];
};

if (_nearbank) then {
    if !([ player,_costs] call SC_fnc_removeCoins) then {
        titleText [format["Needss %1 %2 to buy .",_costs,CurrencyName] , "PLAIN DOWN", 1];
    } else {
    titleText [format["bought %1  %2 %3",_costs,CurrencyName] , "PLAIN DOWN", 1];

    lastlaunch = time;
multiPlyWith = 1;
_i=0;

while {_i < 7} do
{
    if ( _i == 1) then
    {
        _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'>Pay Day!</t><br/><t align='center' color='#17FF41'>------------------------------</t><br/><t align='center' color='#FFFFFF'>%1 Tnks for buy Bonus: </t><t align='center' color='#40FF00'>$%2</t>", name player, _reward];
        hint _msg;
        multiPlyWith = multiPlyWith + 0;
        _i = 0;
    };
    sleep 1200;
    _i = _i + 1;
    
};
};
};

 

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

Spoiler

////////////License//
private["_playerPos","_nearbank"];

_playerPos = getPosATL player;
_nearbank = count nearestObjects [_playerPos, ["GUE_Woodlander2"], 3] > 0;
 
if (_nearbank) then {
        if (s_player_lic1 < 0) then {
            s_player_lic1 = player addaction[("<t color=""#3399cc"">" + ("Buy License") +"</t>"),"custom\bonus\license.sqf"];
        };
    } else {
        player removeAction s_player_lic1;
        s_player_lic1 = -1;
    };
////////////////

////////////bonus//
private["_playerPos","_nearbank"];

_playerPos = getPosATL player;
_nearbank = count nearestObjects [_playerPos, ["GUE_Woodlander2"], 3] > 0;
 
if (_nearbank) then {
        if (s_player_bon1 < 0) then {
            s_player_bon1 = player addaction[("<t color=""#3399cc"">" + ("Buy Bonus") +"</t>"),"custom\bonus\bonus.sqf"];
        };
    } else {
        player removeAction s_player_bon1;
        s_player_bon1 = -1;
    };
////////////////

 

 

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

 

Link to comment
Share on other sites

  • 4 weeks later...
On 2016. 06. 20. at 5: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

private ["_playerPos","_neartrader","_costs","_haslicence"];

call gear_ui_init;
_playerPos = getPosATL player;
_neartrader = count nearestObjects [_playerPos, ["GUE_Woodlander2"], 3] > 0;
_costs = 5000;
_haslicence = "ItemBook2" in magazines player;

if (_haslicence) exitWith {cutText [format["already have a licensee"], "PLAIN DOWN"];};

if (_neartrader) then {
    if !([ player,_costs] call SC_fnc_removeCoins) then {
        titleText [format["Needs%1 %2 to buy this license.",_costs,CurrencyName] , "PLAIN DOWN", 1];
    } else {
    titleText [format["bought %1  %2 %3",_costs,CurrencyName] , "PLAIN DOWN", 1];
    player addMagazine "ItemBook2";
    sleep 5;
            
  };    
};

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

  Hide contents

private ["_playerPos","_nearbank","_costs","_hasbonus","_reward","_msg","_LastUsedTime","_Time"];

call gear_ui_init;
_playerPos = getPosATL player;
_nearbank = count nearestObjects [_playerPos, ["GUE_Woodlander2"], 3] > 0;
_costs = 5000;
_hasbonus = "ItemBook2" in magazines player;
_LastUsedTime = 3600;
_Time = time - lastlaunch;

if !(_hasbonus) exitWith {cutText [format["Need a license to buy a bonus"], "PLAIN DOWN"];};

 

 

if(_Time < _LastUsedTime) exitWith {
    cutText [format["already have a bonus wait %1 seconds !",(round(_Time - _LastUsedTime))], "PLAIN DOWN"];
};

if (_nearbank) then {
    if !([ player,_costs] call SC_fnc_removeCoins) then {
        titleText [format["Needss %1 %2 to buy .",_costs,CurrencyName] , "PLAIN DOWN", 1];
    } else {
    titleText [format["bought %1  %2 %3",_costs,CurrencyName] , "PLAIN DOWN", 1];

    lastlaunch = time;
multiPlyWith = 1;
_i=0;

while {_i < 7} do
{
    if ( _i == 1) then
    {
        _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'>Pay Day!</t><br/><t align='center' color='#17FF41'>------------------------------</t><br/><t align='center' color='#FFFFFF'>%1 Tnks for buy Bonus: </t><t align='center' color='#40FF00'>$%2</t>", name player, _reward];
        hint _msg;
        multiPlyWith = multiPlyWith + 0;
        _i = 0;
    };
    sleep 1200;
    _i = _i + 1;
    
};
};
};

 

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

  Hide contents

////////////License//
private["_playerPos","_nearbank"];

_playerPos = getPosATL player;
_nearbank = count nearestObjects [_playerPos, ["GUE_Woodlander2"], 3] > 0;
 
if (_nearbank) then {
        if (s_player_lic1 < 0) then {
            s_player_lic1 = player addaction[("<t color=""#3399cc"">" + ("Buy License") +"</t>"),"custom\bonus\license.sqf"];
        };
    } else {
        player removeAction s_player_lic1;
        s_player_lic1 = -1;
    };
////////////////

////////////bonus//
private["_playerPos","_nearbank"];

_playerPos = getPosATL player;
_nearbank = count nearestObjects [_playerPos, ["GUE_Woodlander2"], 3] > 0;
 
if (_nearbank) then {
        if (s_player_bon1 < 0) then {
            s_player_bon1 = player addaction[("<t color=""#3399cc"">" + ("Buy Bonus") +"</t>"),"custom\bonus\bonus.sqf"];
        };
    } else {
        player removeAction s_player_bon1;
        s_player_bon1 = -1;
    };
////////////////

 

 

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

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

Spoiler

private ["_playerPos","_neartrader","_amount","_haslicence","_wealth"];
_amount = 5000;
_haslicence = "ItemBook2" in magazines player;

if (_haslicence) exitWith {cutText [format["already have a licensee"], "PLAIN DOWN"];};


_wealth = player getVariable[Z_MoneyVariable,0];

if (_wealth > _amount) then {
player setVariable[Z_MoneyVariable,(_wealth - _amount),true];

systemChat ("you bought a license");
player addMagazine "ItemBook2";

    } else {
  systemChat ("you need 5000 coins");          
  };    
 

 

 

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

Spoiler

//----------------------------------------------------------------------//	
// Auzgamer Pattoh Salival Choc Loyalty Reward System   
//------------------------------------------------------------------//
private ["_mply","_i","_reward","_hmnty","_servername","_coinsreward","_msg","_nxtlvl","_currency","_timer"];
diag_log("Survivor Rewards Log: Started!");
_hmnty = player getVariable ["humanity",0];
//------------------------Config----------------------------//
_servername = "Your Server Name Here";		// Server Name
_currency = "Coins!";												// Currency Name
_coinsreward = 2500;											// Reward Amount
_timer = 1800;															// Reward Timer in Seconds
//----------------------------------------------------------//
switch (true) do {
    case (_hmnty >= -5000 && _hmnty <= 5000): {_mply = 1.0};			// Bambie
	case (_hmnty >= 5000):			{_mply = 1.2};												// Hero
	case (_hmnty >= 15000):		{_mply = 1.4};												//
	case (_hmnty >= 25000): 		{_mply = 1.6};												//
	case (_hmnty >= 45000):		{_mply = 1.7};												//
	case (_hmnty >= 85000):		{_mply = 1.8};												//
	case (_hmnty >= 100000):	{_mply = 2};													// Super Hero								
	case (_hmnty <= -5000):		{_mply = 1.0};												// Bandit
	case (_hmnty <= -10000):		{_mply = 1.2};												//
	case (_hmnty <= -25000):		{_mply = 1.4};												//
	case (_hmnty <= -45000):		{_mply = 1.6};												//
	case (_hmnty <= -85000):		{_mply = 1.8};												//
	case (_hmnty <= -100000):	{_mply = 1.9};												// Super Bandit
};

	if  (_hmnty >= -5000 &&	 _hmnty <= 5000) then {_nxtlvl = "2.5k/-5k" };	// Bambie
	if  (_hmnty >= 5000) then		{_nxtlvl = "15000"};										// Hero
	if  (_hmnty >= 15000) then		{_nxtlvl = "25000"};									//
	if  (_hmnty >= 25000) then 		{_nxtlvl = "45000"};									//
	if  (_hmnty >= 45000) then		{_nxtlvl = "85000"};									//
	if  (_hmnty >= 85000) then		{_nxtlvl = "100000"};								//
	if  (_hmnty >= 100000) then		{_nxtlvl = "100%"};									// Super Hero								
	if  (_hmnty <= -5000) then			{_nxtlvl = "-10000"};									// Bandit
	if  (_hmnty <= -10000) then		{_nxtlvl = "-25000"};									//
	if  (_hmnty <= -25000) then		{_nxtlvl = "-45000"};									//
	if  (_hmnty <= -45000) then		{_nxtlvl = "-85000"};									//
	if  (_hmnty <= -85000) then		{_nxtlvl = "-100000"};								//
	if  (_hmnty <= -100000) then		{_nxtlvl = "100%"};									// Super Bandit

//----------------------------------------------------------//
_i=0;
while {_i < 7} do	{
	if ( _i == 1) then 	{
        if (isInTraderCity) then {
            format ["Survivor Rewards! %1 But you missed out! Payments are not given to those in traders! ",name player] call dayz_rollingMessages;
        } else {
			_reward = (_coinsreward * _mply);
			_msg = parseText format ["
			<t align='center' color='#D9FF00' shadow='2' size='1.5'>Survival Rewards!</t><br/><br/>
			<t align='left' shadow='2' size='1.2' color='#A23DFF'>Humanity: </t><t align='right' shadow='2' size='1.2' color='#FFFFFF'>%3</t><br/>
			<t align='left' shadow='2' size='1.2' color='#A23DFF'>Next level: </t><t align='right' shadow='2' size='1.2' color='#FFFFFF'>%6</t>
			<t size='1' font='Zeppelin33' align='center' color='#CCCCCC'> ------------------------------ </t><br/>
			<t align='center' shadow='2' size='1.2' color='#8CFA16'>Humanity Bonus<t/><br/>
			<t align='center' shadow='2' size='1.3' color='#FFFFFF'>%4 x %2</t>
			<t size='1' font='Zeppelin33' align='center' color='#CCCCCC'> ------------------------------ </t>
			<t align='center' shadow='2' size='1.45' color='#D0F000'>%1 %7</t><br/>
			<t align='center' shadow='2' size='1.1' color='#FFFFFF'>Thanks for playing</t><br/>
			<t align='center' color='#CCCCCC' shadow='2' size='1'>%5</t><br/>
			",
			_reward,				//	1
			_mply,					//	2
			_hmnty,					//	3
			_coinsreward,		//	4
			_servername,		//	5
			_nxtlvl,					//	6
			_currency				//	7
			];
			hint _msg;
			diag_log format ["Survivor Rewards Log: Reward: %1 Multiplier: %2",_reward,_mply];
	        player setVariable [Z_moneyVariable,((player getVariable [Z_moneyVariable, 0]) + _reward),true];
        };
        _i = 0;
    };
	uisleep _timer;
	_i = _i + 1;
};

 

 

Link to comment
Share on other sites

On 24.05.2017 at 5: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


//----------------------------------------------------------------------//	
// Auzgamer Pattoh Salival Choc Loyalty Reward System   
//------------------------------------------------------------------//
private ["_mply","_i","_reward","_hmnty","_servername","_coinsreward","_msg","_nxtlvl","_currency","_timer"];
diag_log("Survivor Rewards Log: Started!");
_hmnty = player getVariable ["humanity",0];
//------------------------Config----------------------------//
_servername = "Your Server Name Here";		// Server Name
_currency = "Coins!";												// Currency Name
_coinsreward = 2500;											// Reward Amount
_timer = 1800;															// Reward Timer in Seconds
//----------------------------------------------------------//
switch (true) do {
    case (_hmnty >= -5000 && _hmnty <= 5000): {_mply = 1.0};			// Bambie
	case (_hmnty >= 5000):			{_mply = 1.2};												// Hero
	case (_hmnty >= 15000):		{_mply = 1.4};												//
	case (_hmnty >= 25000): 		{_mply = 1.6};												//
	case (_hmnty >= 45000):		{_mply = 1.7};												//
	case (_hmnty >= 85000):		{_mply = 1.8};												//
	case (_hmnty >= 100000):	{_mply = 2};													// Super Hero								
	case (_hmnty <= -5000):		{_mply = 1.0};												// Bandit
	case (_hmnty <= -10000):		{_mply = 1.2};												//
	case (_hmnty <= -25000):		{_mply = 1.4};												//
	case (_hmnty <= -45000):		{_mply = 1.6};												//
	case (_hmnty <= -85000):		{_mply = 1.8};												//
	case (_hmnty <= -100000):	{_mply = 1.9};												// Super Bandit
};

	if  (_hmnty >= -5000 &&	 _hmnty <= 5000) then {_nxtlvl = "2.5k/-5k" };	// Bambie
	if  (_hmnty >= 5000) then		{_nxtlvl = "15000"};										// Hero
	if  (_hmnty >= 15000) then		{_nxtlvl = "25000"};									//
	if  (_hmnty >= 25000) then 		{_nxtlvl = "45000"};									//
	if  (_hmnty >= 45000) then		{_nxtlvl = "85000"};									//
	if  (_hmnty >= 85000) then		{_nxtlvl = "100000"};								//
	if  (_hmnty >= 100000) then		{_nxtlvl = "100%"};									// Super Hero								
	if  (_hmnty <= -5000) then			{_nxtlvl = "-10000"};									// Bandit
	if  (_hmnty <= -10000) then		{_nxtlvl = "-25000"};									//
	if  (_hmnty <= -25000) then		{_nxtlvl = "-45000"};									//
	if  (_hmnty <= -45000) then		{_nxtlvl = "-85000"};									//
	if  (_hmnty <= -85000) then		{_nxtlvl = "-100000"};								//
	if  (_hmnty <= -100000) then		{_nxtlvl = "100%"};									// Super Bandit

//----------------------------------------------------------//
_i=0;
while {_i < 7} do	{
	if ( _i == 1) then 	{
        if (isInTraderCity) then {
            format ["Survivor Rewards! %1 But you missed out! Payments are not given to those in traders! ",name player] call dayz_rollingMessages;
        } else {
			_reward = (_coinsreward * _mply);
			_msg = parseText format ["
			<t align='center' color='#D9FF00' shadow='2' size='1.5'>Survival Rewards!</t><br/><br/>
			<t align='left' shadow='2' size='1.2' color='#A23DFF'>Humanity: </t><t align='right' shadow='2' size='1.2' color='#FFFFFF'>%3</t><br/>
			<t align='left' shadow='2' size='1.2' color='#A23DFF'>Next level: </t><t align='right' shadow='2' size='1.2' color='#FFFFFF'>%6</t>
			<t size='1' font='Zeppelin33' align='center' color='#CCCCCC'> ------------------------------ </t><br/>
			<t align='center' shadow='2' size='1.2' color='#8CFA16'>Humanity Bonus<t/><br/>
			<t align='center' shadow='2' size='1.3' color='#FFFFFF'>%4 x %2</t>
			<t size='1' font='Zeppelin33' align='center' color='#CCCCCC'> ------------------------------ </t>
			<t align='center' shadow='2' size='1.45' color='#D0F000'>%1 %7</t><br/>
			<t align='center' shadow='2' size='1.1' color='#FFFFFF'>Thanks for playing</t><br/>
			<t align='center' color='#CCCCCC' shadow='2' size='1'>%5</t><br/>
			",
			_reward,				//	1
			_mply,					//	2
			_hmnty,					//	3
			_coinsreward,		//	4
			_servername,		//	5
			_nxtlvl,					//	6
			_currency				//	7
			];
			hint _msg;
			diag_log format ["Survivor Rewards Log: Reward: %1 Multiplier: %2",_reward,_mply];
	        player setVariable [Z_moneyVariable,((player getVariable [Z_moneyVariable, 0]) + _reward),true];
        };
        _i = 0;
    };
	uisleep _timer;
	_i = _i + 1;
};

 

how can i add it on server?

 

Link to comment
Share on other sites

5 minutes ago, 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"

};

Spoiler

11:02:57 "Survivor Rewards Log: Started!"

11:02:57 Error in expression <													


 

switch (true) do {

case (_hmnty >= -5000 && _hmnty <= 5000): {_mp>

11:02:57   Error position: <_hmnty >= -5000 && _hmnty <= 5000): {_mp>

11:02:57   Error Undefined variable in expression: _hmnty

11:02:57 File mpmissions\DayZ_Epoch_11.Chernarus\Custom\player_rewards.sqf, line 14

11:02:57 Error in expression <0):	{_mply = 1.9};												

};


 

if  (_hmnty >= -5000 &&	 _hmnty <= 5000) then>

11:02:57   Error position: <_hmnty >= -5000 &&	 _hmnty <= 5000) then>

11:02:57   Error Undefined variable in expression: _hmnty

11:02:57 File mpmissions\DayZ_Epoch_11.Chernarus\Custom\player_rewards.sqf, line 29

 

Link to comment
Share on other sites

5 minutes ago, Ghostman said:
  Hide contents


11:02:57 "Survivor Rewards Log: Started!"


11:02:57 Error in expression <													



 


switch (true) do {


case (_hmnty >= -5000 && _hmnty <= 5000): {_mp>


11:02:57   Error position: <_hmnty >= -5000 && _hmnty <= 5000): {_mp>


11:02:57   Error Undefined variable in expression: _hmnty


11:02:57 File mpmissions\DayZ_Epoch_11.Chernarus\Custom\player_rewards.sqf, line 14


11:02:57 Error in expression <0):	{_mply = 1.9};												


};



 


if  (_hmnty >= -5000 &&	 _hmnty <= 5000) then>


11:02:57   Error position: <_hmnty >= -5000 &&	 _hmnty <= 5000) then>


11:02:57   Error Undefined variable in expression: _hmnty


11:02:57 File mpmissions\DayZ_Epoch_11.Chernarus\Custom\player_rewards.sqf, line 29

 

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

Link to comment
Share on other sites

4 minutes ago, salival said:

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

new error reward added but.

Spoiler

11:21:10 Error in expression <ges;

} else {

_reward = (_coinsreward * _mply);

_msg = parseText format ["

			<t>

11:21:10   Error position: <_mply);

_msg = parseText format ["

			<t>

11:21:10   Error Undefined variable in expression: _mply

11:21:10 File mpmissions\DayZ_Epoch_11.Chernarus\Custom\player_rewards.sqf , line 50

 

Link to comment
Share on other sites

39 minutes ago, Ghostman said:

new error reward added but.

  Hide contents


11:21:10 Error in expression <ges;


} else {


_reward = (_coinsreward * _mply);


_msg = parseText format ["


			<t>


11:21:10   Error position: <_mply);


_msg = parseText format ["


			<t>


11:21:10   Error Undefined variable in expression: _mply


11:21:10 File mpmissions\DayZ_Epoch_11.Chernarus\Custom\player_rewards.sqf , line 50

 

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

6 minutes ago, 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];

 

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 12/01/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

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

46 minutes ago, 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

 

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