Jump to content
Raul125

[TUTORIAL] WORK AT McDonald's

Recommended Posts

Hello, 

Here is a tutorial on how to work in McDonald´s.

Difficulty: Easy

Source:  

Author: MrKraken / Edited by me.

 

_____________________________________________________________________________________________________________________________________

1. Navigate to the core folder and then the functions folder, create a file called fn_work.sqf and paste the following or download it:

/*
file: fn_work.sqf
Author: MrKraken
Made from MrKrakens shop robbing tutorial on www.altisliferpg.com forums // Edited By Raúl Rueda // Free
Description:
Executes the work action!
Idea developed by PEpwnzya v1.0
*/
private["_robber","_shop","_kassa","_ui","_progress","_pgText","_cP","_rip","_pos"];
_shop = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param; //The object that has the action attached to it is _this. ,0, is the index of object, ObjNull is the default should there be nothing in the parameter or it's broken
_robber = [_this,1,ObjNull,[ObjNull]] call BIS_fnc_param; //Can you guess? Alright, it's the player, or the "caller". The object is 0, the person activating the object is 1
//_kassa = 1000; //The amount the shop has to rob, you could make this a parameter of the call (https://community.bistudio.com/wiki/addAction). Give it a try and post below ;)
_action = [_this,2] call BIS_fnc_param;//Action name

if(side _robber != civilian) exitWith { hint "You can not work here!" };
if(_robber distance _shop > 10) exitWith { hint "You need to be within 15m of the cashier to work!" };

if !(_kassa) then { _kassa = 1000; };
if (_rip) exitWith { hint "Already started work!" };
if (vehicle player != _robber) exitWith { hint "Get out of your vehicle!" };

_rip = true;
_kassa = 6000 + round(random 5200);
_shop removeAction _action;
_chance = random(100);
[[2,"MCDONALDS IS OPEN FOR BUSINESS"],"life_fnc_broadcast",nil,false] spawn life_fnc_MP;
 
//Setup our progress bar.
disableSerialization;
5 cutRsc ["life_progress","PLAIN"];
_ui = uiNameSpace getVariable "life_progress";
_progress = _ui displayCtrl 38201;
_pgText = _ui displayCtrl 38202;
_pgText ctrlSetText format["currently at work (15m) (1%1)...","%"];
_progress progressSetPosition 0.01;
_cP = 0.0005;
 
if(_rip) then
{
while{true} do
{
sleep 0.85;
_cP = _cP + 0.001;
_progress progressSetPosition _cP;
_pgText ctrlSetText format["Working at Mcdonalds, stay close (15m) (%1%2)...",round(_cP * 100),"%"];

if(_cP >= 1) exitWith {};
if(_robber distance _shop > 16) exitWith { };
};
if!(alive _robber) exitWith { _rip = false; };
if(_robber distance _shop > 16) exitWith { _shop switchMove ""; hint "You need to stay within 15m! - Your Fired."; 5 cutText ["","PLAIN"]; _rip = false; };
5 cutText ["","PLAIN"];

titleText[format["You have completed your shift $%1 !",[_kassa] call life_fnc_numberText],"PLAIN"];
life_cash = life_cash + _kassa;
[[1,format["Mcdonalds", _shop, _robber, [_kassa] call life_fnc_numberText]],"life_fnc_broadcast",west,false] spawn life_fnc_MP;
_rip = false;
life_use_atm = true;
if!(alive _robber) exitWith {};
};
sleep 10;
_action = _shop addAction["Start Work",life_fnc_work];
_shop switchMove "";

2. Open your mission.sqm in the editor and go to a gas station you wish to rob and add then following to the init line of the NPC:

this addAction["Start Work",life_fnc_work];

3. Go back to your root directory and open functions.hpp, once opened, find class Functions and at the end of the block add:

class work {};

4. Play and enjoy

fn_work.sqf

Edited by Raul125
  • Haha 1

Share this post


Link to post
Share on other sites
48 minutes ago, imthatguyhere said:

I 100% expected this to be a troll with that title. Thanks for contributing a funky edit and not just a pic of someone at McDicks!

Thank you

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

Important Information

By using this site, you agree to our Terms of Use.