Jump to content

(RELEASE) Loyalty reward system


auzgamer

Recommended Posts

Hi Guys, Thanks auzgamer the the script as supplied works ok no errors but Message is hidden behind my Debug and was reading this post : SchwEde and changed the message so it appears on the lower portion on the screen : like this,

_msg = 1001 cutText ["Thank you for playing on Epoch Survivors, Your Loyalty has been rewarded","PLAIN DOWN",2];

But it is throwing up undefind error :

Error in expression <as been rewarded","PLAIN DOWN",2];
hint _msg;
multiPlyWith = multiPlyWith + 1;
_>
  Error position: <_msg;
multiPlyWith = multiPlyWith + 1;
_>
  Error Undefined variable in expression: _msg
File mpmissions\__CUR_MP.Napf\Custom\fn_rewardLoyalty.sqf, line 11

 

I added -

private [ "_msg"];

to top of script but does not alter the error - Can some one help ?

 

Thanks

MegaZ

Link to comment
Share on other sites

multiPlyWith = 1;
_i=0;

while {_i < 7} do
{
	if ( _i == 1) then 
	{
		_reward = (10000 * multiPlyWith);
		player setVariable ["cashMoney", ((player getVariable ["cashMoney", 0]) + _reward), true];
		cutText [format["Thank you for playing on Epoch Survivors, Your Loyalty has been rewarded"], "PLAIN DOWN"];
		multiPlyWith = multiPlyWith + 1;
		_i = 0;
	};
	sleep 1800;
	_i = _i + 1;
};
Link to comment
Share on other sites

I just edited the original code with the message. I did not ask permission nor I want to edit the code from its original author.

Also I'm pretty aware of it, but how about giving a beer solution for that instead of simply telling that this is a bad idea;P

PS never called myself a coder either :P

Link to comment
Share on other sites

Hi Guys just been informed by player that ever time they die and respawn they are get a new set of Coins?

This is the code in use:

 

multiPlyWith = 1;
_i=0;

while {_i < 7} do
{
if ( _i == 1) then
{
  _reward = (10000 * multiPlyWith);
  player setVariable ["cashMoney", ((player getVariable ["cashMoney", 0]) + _reward), true];
  cutText [format["Thank you for playing on Epoch Survivors, Your Loyalty has been rewarded"], "PLAIN DOWN"];
  multiPlyWith = multiPlyWith + 1;
  _i = 0;
};
sleep 6000;
_i = _i + 1;
};

 

So it will only give player coins after 1hr 40mins  ie once per server restart as I have it set as 3 hours

 

any idea why?

 

MegaZ

Link to comment
Share on other sites

I just edited the original code with the message. I did not ask permission nor I want to edit the code from its original author.

Also I'm pretty aware of it, but how about giving a beer solution for that instead of simply telling that this is a bad idea;P

PS never called myself a coder either :P

 

Take a look at the quoted post below

 

Hi Guys just been informed by player that ever time they die and respawn they are get a new set of Coins?

This is the code in use:

 

code etc

sleep 6000;

 

 

MegaZ

The-Big-Sleep-Wallpaper-classic-movies-5

Link to comment
Share on other sites

  • 2 weeks later...

Any chance to show the reward message longer than 2 secs? the message appears only for about 2 sec and no one can read it.

 

I changed how it displayed the message as it was hiding behind my debug monitor. It now displays in center of the screen for a decent amount of time for all my players to read it.

 

titleText [format ["Loyalty Time Reward! === %1 Thank You for playing on Outsiders Gaming! Your loyalty has been rewarded with: $%2", name player, _reward], "PLAIN DOWN"];

 

The line above is directly from the file.

 

b_560_95_1.png

Link to comment
Share on other sites

 

I changed how it displayed the message as it was hiding behind my debug monitor. It now displays in center of the screen for a decent amount of time for all my players to read it.

 

titleText [format ["Loyalty Time Reward! === %1 Thank You for playing on Outsiders Gaming! Your loyalty has been rewarded with: $%2", name player, _reward], "PLAIN DOWN"];

 

The line above is directly from the file.

 

b_560_95_1.png

 

 

 

Do you not have the problem with when the time is up and people get the money, and if they die and respawn they get the reward again - and can keep doing this till server reset

Link to comment
Share on other sites

  • 2 weeks later...

Do you not have the problem with when the time is up and people get the money, and if they die and respawn they get the reward again - and can keep doing this till server reset

 

I have it set so the players will receive the reward every 30 minutes at the moment. I am trying to figure out how to implement into the code how to void it if they are just sitting in trader zones or at their base. When they die, the timer is reset on their character so they once they log back in, they have to wait another 30 minutes.

 

b_560_95_1.png

Link to comment
Share on other sites

  • 2 weeks later...

I have it set so the players will receive the reward every 30 minutes at the moment. I am trying to figure out how to implement into the code how to void it if they are just sitting in trader zones or at their base. When they die, the timer is reset on their character so they once they log back in, they have to wait another 30 minutes.

 

 

 

 

Hi Johnny, Could you post up you alterations as I had to remove it, As my players were killing themselves and getting back to the corpse to get the money time and time again.

Thanks

MegaZ

Link to comment
Share on other sites

  • 4 weeks later...
  • 4 weeks later...
  • 1 month later...

Awesome idea!

I liked it very much!

May be make the reward for starter/poor players better than to old/rich players. I will try to do that.

Thankyou for sharing!

PS: some people sayd me that is better to use uiSleep instead of sleep. May be it worth the change.

 

Link to comment
Share on other sites

  • 1 month later...
On 7/24/2015 at 4:45 PM, megaz said:

I have it set so the players will receive the reward every 30 minutes at the moment. I am trying to figure out how to implement into the code how to void it if they are just sitting in trader zones or at their base. When they die, the timer is reset on their character so they once they log back in, they have to wait another 30 minutes.

 

 

 

 

Hi Johnny, Could you post up you alterations as I had to remove it, As my players were killing themselves and getting back to the corpse to get the money time and time again.

Thanks

MegaZ

Sorry MegaZ, I wasn't receiving any notifications for this thread. Just saw your message now. My players are receiving the reward every 30 minutes, but they have to be alive for the full 30 minutes in order to receive it. The only thing I edited in this code was the way the messages were displayed and the amounts the players receive. Right now, for the first 30 minutes that they are alive on the server, they will receive $10k. If they manage to stay alive on the server until the next 30 minutes (so the hour mark), they will received $20k. And this continuously adds $10k more each time they hit the next 30 minute mark, as long as they stay alive consecutively. So really, it would benefit them more if they stayed alive instead of dying as all they're doing is resetting the timer.  Do you still need the code ?

Link to comment
Share on other sites

  • 2 weeks later...
On 12/23/2015 at 4:12 AM, megaz said:

Hi Johnny if you dont mind - I would like to put it back in, but cant as it is. As my player just kill them selves over and over.

Tahnks

MegaZ

Sorry for the late reply MegaZ. This is what I am using for the loyalty rewards. They are released to players every 30 minutes. At the 30 minute timer from when they log in, they will receive $10k, if they stay alive and logged in and make it to the 60 minute timer, they will receive $20k, 90 minutes = $30k, and so on. It goes up in $10k interverals When a player dies or relogs, the timer is automatically reset and the first reward they would receive when they hit the next 30 minute mark is $10k again. So really, the smart thing to do is to keep the player alive. In the near future, I am going to add where the player has to be moving and not in a safezone or near plot pole in order to receive this too.

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

multiPlyWith = 1;
_i=0;

while {_i < 7} do
{
    if ( _i == 1) then 
    {
        _reward = (10000 * multiPlyWith);
        player setVariable ["cashMoney", ((player getVariable ["cashMoney", 0]) + _reward), true];
        titleText [format ["Loyalty Time Reward! === %1 Thank You for playing on Outsiders Gaming! Your loyalty has been rewarded with: $%2", name player, _reward], "PLAIN DOWN"];
        multiPlyWith = multiPlyWith + 1;
        _i = 0;
    };
    sleep 1800;
    _i = _i + 1;
};

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Link to comment
Share on other sites

  • 2 weeks later...

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

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