Jump to content
Drunken Cheetah

[Release] How to increase population

Recommended Posts

A nifty little feature, to get your server advertised just from this little piece of code.

 

Goto: MISSION/core/init.sqf

At the bottom somewhere, add the following

[] spawn {
	while {true} do {
		sleep 600;
		sleep (random 30);
		if !(profileNameSteam find "www.WEBSITENAME.com" isEqualTo -1) then {BANK = BANK + 5000; systemChat "You received $5000 for having www.WEBSITENAME.com in your steam name"} else {systemChat "You missed out on $5000, you could get it if you have www.WEBSITENAME.com in your steam name!"};
	};
};

 

This checks the players steamname, if the player has www.WEBSITENAME.com in their name it gives them 5k every so often.

Obviously change the website name to whatever you want it to be, and make sure to change the amount.

  • Like 1
  • Haha 1

Share this post


Link to post
Share on other sites
23 minutes ago, Maihym said:

This is just fucking retarded. I would much rather use Xafloro's scripts than this.

Ok? Nobody is asking you to use it though...

No need to be so hostile, I take it your still salty cause I didn't do player stats for you?

Edited by Drunken Cheetah
  • Like 1

Share this post


Link to post
Share on other sites
8 minutes ago, Drunken Cheetah said:

Ok? Nobody is asking you to use it though...

No need to be so hostile, I take it your still salty cause I didn't do player stats for you?

Oh no I don't care about the player stats thing. I just think your script is shit haha.

Share this post


Link to post
Share on other sites
4 minutes ago, Maihym said:

Oh no I don't care about the player stats thing. I just think your script is shit haha.

Ok, thanks,

If you can come up with something that doesn't involve spamming other communitys, I'd love to see it :)

Edited by Drunken Cheetah
  • Like 1

Share this post


Link to post
Share on other sites

Couldn't  you do the following:

In Config_Master under paycheck settings

/* Special member pay */  //Call it whatever you want
special_paycheck = 5000;


In Altis_Life.Altis/core/init.sqf under paycheck stuff add
special_paycheck = LIFE_SETTINGS(getNumber,"special_paycheck");
CONSTVAR(special_paycheck);

in client.FSM replace

           "    if (player distance (getMarkerPos ""fed_reserve"") < 120 && playerSide isEqualTo west) then {" \n
           "        systemChat format [localize ""STR_FSM_ReceivedPay"",[(call life_paycheck) + 1500] call life_fnc_numberText];" \n
           "        life_atmbank = life_atmbank + (call life_paycheck) + 1500;" \n
           "    } else {" \n
           "        life_atmbank = life_atmbank + (call life_paycheck);" \n
           "        systemChat format [localize ""STR_FSM_ReceivedPay"",[(call life_paycheck)] call life_fnc_numberText];" \n
" };" \n

with

           "    if (player distance (getMarkerPos ""fed_reserve"") < 120 && playerSide isEqualTo west) then {" \n
           "        systemChat format [localize ""STR_FSM_ReceivedPay"",[(call life_paycheck) + 1500] call life_fnc_numberText];" \n
           "        life_atmbank = life_atmbank + (call life_paycheck) + 1500;" \n
           "        if !(profileNameSteam find ""www.WEBSITENAME.com"" isEqualTo -1) then {" \n
           "                systemChat ""You received $5000 for having wwww.WEBSITENAME.com in your steamName;" \n
           "                life_atmbank = life_atmbank + (call special_paycheck);" \n
           "        } else {" \n
           "                systemChat ""You missed out on $5000 due to not having www.WEBSITENAME.com in your steamName;" \n
           "        };" \n
           "    } else {" \n
           "        life_atmbank = life_atmbank + (call life_paycheck);" \n
           "        systemChat format [localize ""STR_FSM_ReceivedPay"",[(call life_paycheck)] call life_fnc_numberText];" \n
           "        if !(profileNameSteam find ""www.WEBSITENAME.com"" isEqualTo -1) then {" \n
           "                systemChat ""You received $5000 for having wwww.WEBSITENAME.com in your steamName;" \n
           "                life_atmbank = life_atmbank + (call special_paycheck);" \n
           "        } else {" \n
           "                systemChat ""You missed out on $5000 due to not having www.WEBSITENAME.com in your steamName;" \n
           "        };" \n
" };" \n


So that the value being given can't be (easily) edited and the players are given the money at the same time as getting their paycheck?

(correct me if I'm wrong I just thought of this on the fly)

Edited by Fawks
Miss-placed a word.
  • Like 3

Share this post


Link to post
Share on other sites
_name = toLower(profileNameSteam);
if !(_name find "www.websitename.com" isEqualTo -1 || {_name find "websitename.com" isEqualTo -1}) then {

Wouldn't this be a better approach?

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, XaFlaForo said:

You shouldn't be running while true statements in your inits period unless it is for testing.

He's not, it is being spawned. While performance wise, it's not good, that statement isn't true. It's not holding the init open.

Share this post


Link to post
Share on other sites
14 hours ago, XaFlaForo said:

@imthatguyhere the finite state machine should be used for while statements like this just like paychecks are

Do you actually know and understand what Finite State Machines are?

  • Haha 1

Share this post


Link to post
Share on other sites
3 hours ago, KLM ✈ said:

Do you actually know and understand what Finite State Machines are?

You mean the FSM is about logic and AI going through states and not just a while loop configuration file? /s

Edited by imthatguyhere

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...