C Program Function Get the resource that will be gathered from the zone name
#include <macro.h> /* Description: Main functionality for gathering. */ if(isNil "life_action_gathering") then {life_action_gathering = false;}; private["_gather","_itemWeight","_diff","_itemName","_resourceZones","_zone","rye_1","hops_1","yeast_1"]; _resourceZones = ["apple_1","apple_2","apple_3","apple_4","peaches_1","peaches_2","peaches_3","peaches_4","heroin_1","cocaine_1","weed_1"]; _zone = ""; if(life_action_gathering) exitWith {}; //Action is in use, exit to prevent spamming. life_action_gathering = true; //Find out what zone we're near { if(player distance (getMarkerPos _x) < 30) exitWith {_zone = _x;}; } foreach _resourceZones; if(EQUAL(_zone,"")) exitWith {life_action_gathering = false;}; //Get the resource that will be gathered from the zone name... switch(true) do { case (_zone in ["apple_1","apple_2","apple_3","apple_4"]): {_gather = ["apple",3];}; case (_zone in ["peaches_1","peaches_2","peaches_3","peaches_4"]): {_gather = ["peach",3];}; case (_zone in ["heroin_1"]): {_gather = ["heroin_unprocessed",1];}; case (_zone in ["cocaine_1"]): {_gather = ["cocaine_unprocessed",1];}; case (_zone in ["weed_1"]): {_gather = ["cannabis",1];}; case (_zone in ["rye_1"]): {_gather = ["rye",2];}; case (_zone in ["yeast_1"]): {_gather = ["yeast",2];}; case (_zone in ["hops_1"]): {_gather = ["hops",2];}; default {""}; }; //gather check?? if(vehicle player != player) exitWith {}; _diff = [SEL(_gather,0),SEL(_gather,1),life_carryWeight,life_maxWeight] call life_fnc_calWeightDiff; if(EQUAL(_diff,0)) exitWith {hint localize "STR_NOTF_InvFull"}; life_action_gathering = true; for "_i" from 0 to 2 do { player playMove "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon"; waitUntil{animationState player != "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";}; sleep 2.5; }; if(([true,SEL(_gather,0),_diff] call life_fnc_handleInv)) then { _itemName = M_CONFIG(getText,"VirtualItems",SEL(_gather,0),"displayName"); titleText[format[localize "STR_NOTF_Gather_Success",(localize _itemName),_diff],"PLAIN"]; }; life_action_gathering = false;
Learn More :
Function
- How to pass one dimensional array to function in c.
- Write a c program which passes two dimension array to function.
- Write overloaded function templates for finding the roots of the linear (a * x + b = 0) and square (a * x2 + b * x + c = 0) uravneniy.Zamechanie: in function to send coefficients of the equations.
- C Program Character toupper() Example
- C Program Function Example
- Napisać funkcję obliczającą funkcję geometryczną w tablicy NxM elementowej z elementów o wartościach parzystych znajdujących się pod główną i ponad przeciwną przekątną.
- C Program To Find LCM and HCF Of Two Number Using Function - 2
- C Program To Convert Temperature In Celsius To Fahrenheit, Using Function
- C Program To Find Simple Interest
- C Function to Check Vowel
- Factorial Program In C Using Function
- C Program For Prime Number Using Function
- C Function to xorSwap and addSwap in C Programming
- C Program to concatenate two strings without using string functions
- C Function to read instructions from the file and obey them
- C program calculates a given function in range given by user, stores the data in arrays and displays the answer in a table.
- C Program to Implements a dictionary's functionality.
- = (int*)malloc(sizeof(int)) ??
- Design a C function that shortens a string to 8 characters
- C Program to Implements a dictionary's functionality
- C Program that prompts the user to input a string, (whitespaces allowed)
- Local sounds functions in C Program
- C Program to Find the Size of File using File Handling Function
- Average function in C
Gathered
Zone