28.08.2015, 15:45
Quote:
I have a system, that players can buy like a business, and each business has 100 slots, like in the enum:
pawn Код:
|
PHP код:
enum E_BUSINESS {
BUSINESS_NAME1[MAX_PLAYERS][24], // is string
BUSINESS_NAME2[MAX_PLAYERS][24], // ...
BUSINESS_NAME3[MAX_PLAYERS][24], // eof string
BUSINESS_COST1[MAX_PLAYERS] // is integer
BUSINESS_COST2[MAX_PLAYERS] // ...
BUSINESS_COST3[MAX_PLAYERS] // eof integer
}
new business[100][E_BUSINESS]; // declaration
business[0][BUSINESS_NAME2][playerid] = "My Bussuname"; // set varlue
business[0][BUSINESS_COST2][playerid] = 10000;
// Test
for (new i; i < 100; i++) {
printf("index %d bussuname '%s' cost $%d", i, business[i][BUSINESS_NAME2][playerid], business[i][BUSINESS_COST2][playerid]);
}