06.03.2017, 04:49
(
Последний раз редактировалось JessThompson; 06.03.2017 в 07:31.
)
Код:
{
new total = 0, cell = 1, pickupmodel, LabelCell[258], InitialTicks = GetTickCount();
static
rows,
fields;
cache_get_data(rows, fields, g_iHandle);
if(rows)
{
while(total < rows)
{
CellSystem[cell][CellSQLID] = cache_get_row_int(total, 0);
cache_get_field_content(total, "Cell_Name", CellSystem[cell][CellName], g_iHandle, 128);
CellSystem[cell][CellLocked] = cache_get_field_int(total, "Cell_Locked");
CellSystem[cell][CellOwner] = cache_get_field_int(total, "Cell_Owner");
CellSystem[cell][CellPrice] = cache_get_field_int(total, "Cell_Price");
CellSystem[cell][CellLevel] = cache_get_field_int(total, "Cell_Level");
CellSystem[cell][CellWeaponOne] = cache_get_field_int(total, "Cell_Weapon_One");
CellSystem[cell][CellWeaponTwo] = cache_get_field_int(total, "Cell_Weapon_Two");
CellSystem[cell][CellWeed] = cache_get_field_int(total, "Cell_Weed");
CellSystem[cell][CellCoke] = cache_get_field_int(total, "Cell_Coke");
CellSystem[cell][CellEntPosX] = cache_get_field_float(total, "Cell_Ent_Pos_X");
CellSystem[cell][CellEntPosY] = cache_get_field_float(total, "Cell_Ent_Pos_Y");
CellSystem[cell][CellEntPosZ] = cache_get_field_float(total, "Cell_Ent_Pos_Z");
CellSystem[cell][CellExtPosX] = cache_get_field_float(total, "Cell_Ext_Pos_X");
CellSystem[cell][CellExtPosY] = cache_get_field_float(total, "Cell_Ext_Pos_Y");
CellSystem[cell][CellExtPosZ] = cache_get_field_float(total, "Cell_Ext_Pos_Z");
CellSystem[cell][CellLoaded] = 1;
if(CellSystem[cell][CellOwner] == -1) pickupmodel = 19522;
else pickupmodel = 1273;
CellSystem[cell][CellPickup] = CreateDynamicPickup(pickupmodel, 23, CellSystem[cell][CellEntPosX], CellSystem[cell][CellEntPosY], CellSystem[cell][CellEntPosZ], 0, -1, -1, 20.0);
if(CellSystem[cell][CellOwner] == -1) format(LabelCell, sizeof(LabelCell), "%s\n /buycell to buy this cell for $%d", CellSystem[cell][CellName], CellSystem[cell][CellPrice]);
//else format(LabelCell, sizeof(LabelCell), "%s\n Owner: %s | Cell level: %i | Cell Locked: %i", CellSystem[cell][CellName], ReturnNameFromID(CellSystem[cell][CellOwner]), CellSystem[cell][CellLevel], CellSystem[cell][CellLocked]);
CellSystem[cell][CellLabel] = CreateDynamic3DTextLabel(LabelCell, -1, CellSystem[cell][CellEntPosX], CellSystem[cell][CellEntPosY], CellSystem[cell][CellEntPosZ]+0.5, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, 0, -1, -1, 15.0);
total++;
cell ++;
printf("loop id: %i | enum id: %i | Cell Name: %s", cell, CellSystem[cell][CellSQLID], CellSystem[cell][CellName]);
}
}
printf("%i cells have been successfully loaded. [%i miliseconds]", cache_num_rows(), GetTickCount() - InitialTicks);
return 1;
}
Код:
[00:40:55] loop id: 2 | enum id: 0 | Cell Name: [00:40:55] loop id: 3 | enum id: 0 | Cell Name: [00:40:55] loop id: 4 | enum id: 0 | Cell Name: [00:40:55] loop id: 5 | enum id: 0 | Cell Name: [00:40:55] loop id: 6 | enum id: 0 | Cell Name: [00:40:55] loop id: 7 | enum id: 0 | Cell Name: [00:40:55] loop id: 8 | enum id: 0 | Cell Name: [00:40:55] loop id: 9 | enum id: 0 | Cell Name: [00:40:55] loop id: 10 | enum id: 0 | Cell Name: [00:40:55] loop id: 11 | enum id: 0 | Cell Name: [00:40:55] loop id: 12 | enum id: 0 | Cell Name: [00:40:55] loop id: 13 | enum id: 0 | Cell Name: [00:40:55] loop id: 14 | enum id: 0 | Cell Name: [00:40:55] loop id: 15 | enum id: 0 | Cell Name: [00:40:55] loop id: 16 | enum id: 0 | Cell Name: [00:40:55] loop id: 17 | enum id: 0 | Cell Name: [00:40:55] loop id: 18 | enum id: 0 | Cell Name: [00:40:55] loop id: 19 | enum id: 0 | Cell Name: [00:40:55] loop id: 20 | enum id: 0 | Cell Name: [00:40:55] loop id: 21 | enum id: 0 | Cell Name: [00:40:55] loop id: 22 | enum id: 0 | Cell Name: [00:40:55] loop id: 23 | enum id: 0 | Cell Name: [00:40:55] loop id: 24 | enum id: 0 | Cell Name: [00:40:55] loop id: 25 | enum id: 0 | Cell Name: [00:40:55] loop id: 26 | enum id: 0 | Cell Name: [00:40:55] loop id: 27 | enum id: 0 | Cell Name: [00:40:55] loop id: 28 | enum id: 0 | Cell Name: [00:40:55] loop id: 29 | enum id: 0 | Cell Name: [00:40:55] loop id: 30 | enum id: 0 | Cell Name: [00:40:55] loop id: 31 | enum id: 0 | Cell Name: [00:40:55] loop id: 32 | enum id: 0 | Cell Name: [00:40:55] loop id: 33 | enum id: 0 | Cell Name: [00:40:55] loop id: 34 | enum id: 0 | Cell Name: [00:40:55] loop id: 35 | enum id: 0 | Cell Name: [00:40:55] loop id: 36 | enum id: 0 | Cell Name: [00:40:55] loop id: 37 | enum id: 0 | Cell Name: [00:40:55] loop id: 38 | enum id: 0 | Cell Name: [00:40:55] loop id: 39 | enum id: 0 | Cell Name: [00:40:55] loop id: 40 | enum id: 0 | Cell Name: [00:40:55] loop id: 41 | enum id: 0 | Cell Name: [00:40:55] loop id: 42 | enum id: 0 | Cell Name: [00:40:55] loop id: 43 | enum id: 0 | Cell Name: [00:40:55] loop id: 44 | enum id: 0 | Cell Name: [00:40:55] loop id: 45 | enum id: 0 | Cell Name: [00:40:55] loop id: 46 | enum id: 0 | Cell Name: [00:40:55] loop id: 47 | enum id: 0 | Cell Name: [00:40:55] loop id: 48 | enum id: 0 | Cell Name: [00:40:55] loop id: 49 | enum id: 0 | Cell Name: [00:40:55] loop id: 50 | enum id: 0 | Cell Name: [00:40:55] loop id: 51 | enum id: 0 | Cell Name:
This is my MySQL table


