25.09.2013, 22:41
pawn Код:
case THREAD_LOAD_FACTIONS:
{
new rows, szLabel[128];
cache_get_data(rows, szFields);
for(new row = 0; row < szRows; szRows++)
{
cache_get_field_content(row,"faction_id", szResult); FactionInfo[szRows][fI_iSQLID] = szRows;
cache_get_field_content(row,"badge_colour", szResult); FactionInfo[szRows][fI_bColour] = strval(szResult);
cache_get_field_content(row,"name", szResult); format(FactionInfo[szRows][fI_Name], 40, szResult);
cache_get_field_content(row,"motd", szResult); format(FactionInfo[szRows][fI_MOTD], 64, szResult);
cache_get_field_content(row,"leader", szResult); format(FactionInfo[szRows][fI_Leader], 24, szResult);
cache_get_field_content(row,"type", szResult); FactionInfo[szRows][fI_iType] = strval(szResult);
cache_get_field_content(row,"leader_rank", szResult); FactionInfo[szRows][fI_LRank] = strval(szResult);
cache_get_field_content(row,"balance", szResult); FactionInfo[szRows][fI_vBalance] = strval(szResult);
cache_get_field_content(row,"lock_stock", szResult); FactionInfo[szRows][fI_wStock] = strval(szResult);
cache_get_field_content(row,"lock_vw", szResult); FactionInfo[szRows][fI_vVW] = strval(szResult);
cache_get_field_content(row,"lock_intid", szResult); FactionInfo[szRows][fI_vIntID] = strval(szResult);
cache_get_field_content(row,"lock_posX", szResult); FactionInfo[szRows][fI_vPos][0] = floatstr(szResult);
cache_get_field_content(row,"lock_posY", szResult); FactionInfo[szRows][fI_vPos][1] = floatstr(szResult);
cache_get_field_content(row,"lock_posZ", szResult); FactionInfo[szRows][fI_vPos][2] = floatstr(szResult);
for(new r = 0; r < MAX_FACTION_RANK; r++) { format(szLabel, sizeof(szLabel), "rank_%d", r); cache_get_field_content(0, szLabel, FactionRanks[szRows][r], MainPipeline); }
for(new w = 0; w < MAX_FACTION_WEAPON; w++) { format(szLabel, sizeof(szLabel), "weapon_%d", w+1); cache_get_field_content(0, szLabel, szResult); FactionInfo[szRows][fI_Weapons][w] = strval(szResult); }
for(new d = 0; d < MAX_FACTION_DIVISION; d++) { format(szLabel, sizeof(szLabel), "division_%d", d+1); cache_get_field_content(0, szLabel, FactionDivisions[szRows][d], MainPipeline); }
for(new pay = 0; pay < MAX_FACTION_RANK; pay++) { format(szLabel, sizeof(szLabel), "pay_%d", pay+1); cache_get_field_content(0, szLabel, szResult); FactionPay[szRows][pay] = strval(szResult); }
DestroyDynamic3DTextLabel(FactionInfo[szRows][fI_vLabel]);
format(szLabel, sizeof(szLabel), "[ %s Locker ]", FactionInfo[szRows][fI_Name]);
FactionInfo[szRows][fI_vLabel] = CreateDynamic3DTextLabel(szLabel, COLOR_WHITE, FactionInfo[szRows][fI_vPos][0], FactionInfo[szRows][fI_vPos][1], FactionInfo[szRows][fI_vPos][2], 10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1,FactionInfo[szRows][fI_vVW], FactionInfo[szRows][fI_vIntID], -1);
DestroyDynamic3DTextLabel(FactionInfo[szRows][fI_vLabel]);
FactionInfo[szRows][fI_vPickup] = CreateDynamicPickup(1239, 23, FactionInfo[szRows][fI_vPos][0], FactionInfo[szRows][fI_vPos][1], FactionInfo[szRows][fI_vPos][2], FactionInfo[szRows][fI_vVW]);
FactionInfo[szRows][fI_vLabel] = CreateDynamic3DTextLabel(szLabel, COLOR_WHITE, FactionInfo[szRows][fI_vPos][0], FactionInfo[szRows][fI_vPos][1], FactionInfo[szRows][fI_vPos][2], 10, -1, -1, 1,FactionInfo[szRows][fI_vVW], FactionInfo[szRows][fI_vIntID], -1);
printf("[SERVER]: %d factions were loaded.", szRows);
}
}
Any help, please?