Quote:
Originally Posted by Konstantinos
So you sort of want to have both workers and their name into the enum? I don't think that's possible.
The only way, I could think of is basically a 3D array - not related with BusinessInfo array.
pawn Код:
new Business_Worker[MAX_BUSINESS_CREATED][MAX_BUSINESS_WORKERS][MAX_PLAYER_NAME];
Having MAX_BUSINESS_WORKERS out of the enum would be a solution too but I believe that's not what you want as the rest of the data are not related to the workers.
|
------------------
Let me elaborate so it is understood what I'm doing.
Here's how
Код:
MAX_BUSINESS_CREATED
is defined
pawn Код:
//--------BUSINESS SYSTEM INFORMATION--------------------------------------//
//SET MAIN DEFINE AS 0
#define MAX_CREATED_BUSINESS 0
//REDEFINE THIS BY FILE CHECK - HOW MANY CREATED
new CREATED_BUSINESS = 0;
new BUSINESS_AMOUNT = MAX_CREATED_BUSINESS+CREATED_BUSINESS;
//--------BUSINESS SYSTEM INFORMATION END----------------------------------//
Here's the enum using
Код:
MAX_BUSINESS_CREATED
pawn Код:
enum bInfo
{
//BASIC BUSINESS INFORMATION
bCreated,//If this business exists
bOwned,//Is this business owned?
bOwnerName[MAX_PLAYER_NAME],//If it's owned what's the owners name?
bBusinessName[64],//What is the business's name? - Used for text draw input "bEntraceText" defined below this line
//BUSINESS NAME INFORMATION UPON ENTERING BUSINESS AREA
bEntranceText,//The actual text draw stored in the enum
//THE TYPE OF BUSINESS
bType,//Type: This will define whether it is a shop/trucking etc
//-----------------LOCATION TYPES --------------------//
//THE LOCATION TYPE
bLocationType,//This will determinate what TYPE OF business CAN go here
/*
Type 1: NOT UPGRADABLE
Type 2: SHOP UPGRADE (INCLUDES NIGHTCLUBS && BARS)
Type 3: VEHICLE BASED UPGRADE
Type 4: SHOP && VEHICLE UPGRADE
*/
//BUSINESS LANDLINE NUMBER
bPhone,//Do they have a phone installed?
bPhoneNumber,//Whats the phone number?
//BUSINESS COMMUNICATION SYSTEM
bCommunication,//Does the business have walky talkies?
//BUSINESS PURCHASE SYSTEM - Certain companies will defaultly be payed to the business account of the player
bPurchaseSystem,//Type: Do they have the ability for customers to pay by card or not?
//BUSINESS FOR SALE INFORMATION
bForSale,//Is the business for sale?
bForSalePrice,//How much is the business for sale for?
//BUSINESS FUND INFORMATION
bFunds, //Funds: How much money does this company have? Is it in debt? (This is only set per player not ACTUAL business, reset upon updating player BUSINESS ACCOUNT +positive amount -negative amount)
//BUSINESS WASTE PRODUCTION
bWasteAmount,//Waste: Based on amount of production the business is doing, this will generate waste (THE AMOUNT)
//BUSINESS PROFIT INFORMATION
bProfitEarnt, //Earnt: This will be accumulated upon players working in the company (For companys doing nothing (DEFAULT) earnings will be set) This will define the (FUNDS) amount - || +
bProducts, //Products: How many things (ANYTHING) does the company have to sell? (This includes ANYTHING THE BUSINESS SELLS) If the company has +1 product when some one buys from the business earnings will be higher
//BUSINESS COST INFORMATION
bWorkWage, //Wage: How much will each worker be payed? (Minimum - Maximum) Effects business income
//BUSINESS WORKER INFORMATION
MAX_BUSINESS_WORKERS, //Max: How many workers are in the business?
bWorker[MAX_BUSINESS_WORKERS] = MAX_PLAYER_NAME, //Name: The workers name
bPenalties[MAX_BUSINESS_WORKERS], //Penalties: How many times has the player done something wrong? (Defined by authorities, business owner)
bWorkerExpense[MAX_BUSINESS_WORKERS], //Expense: does the player pay for fuel,repairs etc?
bWorkerRank[MAX_BUSINESS_WORKERS], //Rank: What can they do in the business?
//BUSINESS WORKER APPLICATIONS
MAX_APPLIES_PLAYERS, //Max: How many players applied to work at this company?
bApplied[MAX_APPLIED_PLAYERS] = MAX_PLAYER_NAME, //Name: The applicants name
//BUSINESS PENALTIES
bBusinessPenalties, //Penalties: How many times has the business done something wrong? (Defined by authorities)
bShutdown, //Has the company been shut down? (Defined by authorities)
//BUSINESS ENTRANCE/EXIT INFORMATION
Float:bInsideX,
Float:bInsideY, // Exit position from the inside
Float:bInsideZ,
bExitArea,
Float:bOutsideX,
Float:bOutsideY, // Entrance position from the outside
Float:bOutsideZ,
bEnterArea,
Float:bJobX,
Float:bJobY, // Player job communication point (This will be used for both PUBLIC & PRIVATE set jobs) Join job/Apply for
Float:bJobZ,
bJobArea,
Float:bVehicleInteractX,
Float:bVehicleInteractY, // Vehicle interaction point (Truckers need a load/refill position for example)
Float:bVehicleInteractZ,
bVehicleInteractArea,
//BUSINESS VEHICLE INFORMATION
MAX_BUSINESS_VEHICLES, //Max: How many vehicles are in this business?
bVehicleType[MAX_BUSINESS_VEHICLES], //Type: What type of vehicle is this? (TRUCK: small/med/large) (TRANSPORT: Taxi/bus/coach) (RUBBISH: trash/sweep) < ETC
bVehicle[MAX_BUSINESS_VEHICLES], //VehicleID: What is the ID of this vehicle? (Used to create and interact with THIS vehicle
bVehicleModel[MAX_BUSINESS_VEHICLES], //Model: What is the vehicles model id?
bVehicleX[MAX_BUSINESS_VEHICLES],
bVehicleY[MAX_BUSINESS_VEHICLES], //Position of the vehicle with facing angle
bVehicleZ[MAX_BUSINESS_VEHICLES],
bVehicleFace[MAX_BUSINESS_VEHICLES],
bLastDriver[MAX_BUSINESS_VEHICLES] = MAX_PLAYER_NAME,//Last Driver: Who was driving this vehicle last? (IMPOUNDED VEHICLE by player) - (DESTROYED - by player) < ETC
//BUSINESS DYNAMIC AREAS - Used for use of hotkeys, how large the plot land is (where you can put vehicles etc (RESPAWN POS example))
bArea,//Plot size of the business (User can set respawn pos of vehicle here, open business options dialog, interact in ways like editing business) < ETC
//BUSINESS INSURANCE FOR DISASTERS
bInsurance,//Insurance: Does this company have insurance or not?
bInsuranceType,//Type of insurance: What insurance type do they have? Small/Med/Large for example (free repairs on vehicles etc, vehicle recovery)
bInsuranceClaims,//Claims: How many times has the company made a claim for something? restock of destroyed vehicle, stolen products etc
bInsuranceCost,//Cost: How much each time an insurance payment is made it will deduct from the business funds
//SPECIAL BUSINESS OBJECT/VEHICLE DEFINED BY TYPE
MAX_BUSINESS_SPECIAL, //Max: How many special OBJECT/VEHICLE's are in this business?
bSpecialType[MAX_BUSINESS_SPECIAL],//Special type: Is this an object or a vehicle? (Example: furniture in a shop that NEEDS a dynamic area || Vehicle)
bSpecialArea[MAX_BUSINESS_SPECIAL],
bSpecial[MAX_BUSINESS_SPECIAL],//SpecialID: What is the ID of the OBJECT/VEHICLE_SPECIAL (Used to create and interact with)
bSpecialModel[MAX_BUSINESS_SPECIAL],//Model: What is the model of the OBJECT/VEHICLE_SPECIAL
Float:bSpecialX[MAX_BUSINESS_SPECIAL],
Float:bSpecialY[MAX_BUSINESS_SPECIAL], //Position of the OBJECT/VEHICLE_SPECIAL with facing angle
Float:bSpecialZ[MAX_BUSINESS_SPECIAL],
Float:bSpecialFace[MAX_BUSINESS_SPECIAL]
}
new BusinessInfo[MAX_CREATED_BUSINESS][bInfo];
Here's how
Код:
MAX_CREATED_BUSINESS
is being defined further from 0
pawn Код:
forward CreatedBusinessLoad();
public CreatedBusinessLoad()
{
new File[256];
format(File, sizeof(File), "StreetHustle/Business/MaxCreated.ini");
if(!dini_Exists(File))
{
dini_Create(File);
dini_IntSet(File, "CREATED_BUSINESS_AMOUNT", 0);
printf("[IMPORTANT BUSINESS INFO - NO BUSINESS AMOUNT FOUND]");
}
//LETS GET HOW MANY BUSINESSES THERE ARE TO LOAD
CREATED_BUSINESS = dini_Int(File, "CREATED_BUSINESS_AMOUNT");
printf("[BUSINESS INFORMATION]");
printf("[CREATED] = %d", CREATED_BUSINESS);
return 1;
}
forward CreatedBusinessADD(amount);
public CreatedBusinessADD(amount)
{
new File[256];
format(File, sizeof(File), "StreetHustle/Business/MaxCreated.ini");
if(dini_Exists(File))
{
CREATED_BUSINESS += amount;
dini_IntSet(File, "CREATED_BUSINESS_AMOUNT", CREATED_BUSINESS);
}
return 1;
}
forward CreatedBusinessREMOVE(amount);
public CreatedBusinessREMOVE(amount)
{
new File[256];
format(File, sizeof(File), "StreetHustle/Business/MaxCreated.ini");
if(dini_Exists(File))
{
CREATED_BUSINESS -= amount;
dini_IntSet(File, "CREATED_BUSINESS_AMOUNT", CREATED_BUSINESS);
}
return 1;
}
I need basically to be able to store the players name inside the workers array (which is inside the enum - business array) which is defined in a similar way as MAX_CREATED_BUSINESS it will check how many actually exist inside the file before proceeding to do a loop and load them all.
I hope I've elaborated enough.