Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public: LoadGangRepositories()
- {
- new idx;
- new Cache: result, rows;
- result = mysql_query(mysql, "SELECT * FROM gang_repositories", true);
- rows = cache_num_rows();
- if(rows > MAX_GZ)
- {
- rows = MAX_GZ;
- print("[GangRepositories]: DB rows > MAX_GANG_REPOSITORIES");
- }
- for(idx = 0; idx < rows; idx ++)
- {
- SetGangRepositoryData(idx, GR_GANG, cache_get_field_content_int(idx, "id"));
- SetGangRepositoryData(idx, GR_METALL, cache_get_field_content_int(idx, "metall"));
- SetGangRepositoryData(idx, GR_AMMO, cache_get_field_content_int(idx, "ammo"));
- SetGangRepositoryData(idx, GR_DRUGS, cache_get_field_content_int(idx, "drugs"));
- SetGangRepositoryData(idx, GR_MONEY, cache_get_field_content_int(idx, "money"));
- SetGangRepositoryData(idx, GR_LOCK, bool: cache_get_field_content_int(idx, "lock"));
- new fmt_text[330],
- gang_id = GetGangRepositoryData(idx, GR_GANG);
- format
- (
- fmt_text, sizeof fmt_text,
- "Склад\n\
- %s\n\n\
- {FFFFFF}Наркотики: {ff9900}%d из 20000 г\n\
- {FFFFFF}Патроны: {ff9900}%d из 50000 шт\n\
- {FFFFFF}Металл: {ff9900}%d из 6000 кг\n\
- {FFFFFF}Деньги: {3366FF}$%d\n\n\
- %s\
- ",
- GetTeamName(idx + TEAM_GANG_GROVE),
- GetGangRepositoryData(idx, GR_DRUGS),
- GetGangRepositoryData(idx, GR_AMMO),
- GetGangRepositoryData(idx, GR_METALL),
- GetGangRepositoryData(idx, GR_MONEY),
- GetGangRepositoryData(idx, GR_LOCK) ? "{66CC33}Открыт" : "{FF3300}Закрыт"
- );
- g_gang_repository[idx][GR_LABEL] = CreateDynamic3DTextLabel
- (
- fmt_text,
- 0xFFFFFFFF,
- GetTeamData(idx + TEAM_GANG_GROVE, O_REPOSITORY_POS)[0],
- GetTeamData(idx + TEAM_GANG_GROVE, O_REPOSITORY_POS)[1],
- GetTeamData(idx + TEAM_GANG_GROVE, O_REPOSITORY_POS)[2] + 1.5,
- 10.0
- );
- g_gang_repository[idx][GR_PICKUP] = CreatePickup
- (
- 1239,
- 23,
- GetTeamData(idx + TEAM_GANG_GROVE, O_REPOSITORY_POS)[0],
- GetTeamData(idx + TEAM_GANG_GROVE, O_REPOSITORY_POS)[1],
- GetTeamData(idx + TEAM_GANG_GROVE, O_REPOSITORY_POS)[2],
- -1,
- PICKUP_ACTION_TYPE_GANG_REPOSIT,
- gang_id
- );
- }
- cache_delete(result);
- printf("[GangRepositories]: Склады банд загружены");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement