K
kapangaIII
C++:
public ShowTurretMenu(id, iTurretIndex)
{
client_cmd(id, "spk sound/%s", g_SoundFile[SOUND_MENU_SELECT]);
new szTitle[512], szFormat[128];
new iEnt = g_PlayerTurretEnt[id][iTurretIndex];
new iTurretType = entity_get_int(iEnt, EV_INT_turret_type)
new iTurretAmmo = entity_get_int(iEnt, EV_INT_turret_ammo);
new iDamageLevel = g_PlayerTurretDamageLevel[id][iTurretIndex]
new Float:fFireRate = ((g_TurretsFreqData[iTurretType] / 100.0) * (g_TurretsFireRateData[iTurretType][g_PlayerTurretFireRateLevel[id][iTurretIndex]] / 100.0));
entity_get_string(iEnt, EV_SZ_turret_name, szFormat, 32);
formatex(szTitle, charsmax(szTitle), "\r[\y %s \r] [\y %s\r ]", szFormat, g_TurretsName[iTurretType]);
CreateTurretRanger(id, iEnt, g_PlayerTurretRangeLevel[id][iTurretIndex]);
new totemAbbilities[3];
GetTurretAbilitiesFromTotem(iEnt, totemAbbilities);
if(totemAbbilities[0] || totemAbbilities[1] || totemAbbilities[2])
format(szTitle, charsmax(szTitle), "%s\w + Эффект тотема\r", szTitle);
new iDamageMin = floatround(g_TurretsDamageData[iTurretType][iDamageLevel][0] * (1.0 + totemAbbilities[0] / 100.0));
new iDamageMax = floatround(g_TurretsDamageData[iTurretType][iDamageLevel][1] * (1.0 + totemAbbilities[0] / 100.0));
new iRange = floatround(g_TurretsRangeData[iTurretType][g_PlayerTurretRangeLevel[id][iTurretIndex]] * (1.0 + totemAbbilities[1] / 100.0));
fFireRate *= (1.0 - (totemAbbilities[2] / 100.0));
format(szTitle, charsmax(szTitle), "%s^n[ \yУровень: \w%d\r ] [ \yПатроны: \w%d\r ]^n[ \yУрон: \w%d\y ~\w %d\r ] [ \yРадиус:\w %d\r ]^n[ \yТочность: \w%d%%\r ] [\yПерезарядка: \w%0.2fs\r ]",
szTitle, entity_get_int(iEnt, EV_INT_turret_level), iTurretAmmo ? iTurretAmmo : 0,
iDamageMin, iDamageMax, iRange, g_TurretsAccuracyData[iTurretType][ g_PlayerTurretAccuracyLevel[id][iTurretIndex]], fFireRate)
new iMenu;
if(g_PlayerTouchingTurret[id] != iEnt){
iMenu=menu_create(szTitle, "ShowTurretMenuH2");
formatex(szTitle, charsmax(szTitle), "- Ты должен оставаться возле турели -");
menu_addtext(iMenu, szTitle,0);
menu_additem(iMenu, "nothing there bitch", _, _, menu_makecallback("ShowTurretMenuCb2"));
menu_setprop(iMenu, MPROP_EXITNAME, "Назад");
}
else{
iMenu=menu_create(szTitle, "ShowTurretMenuH");
new cb = menu_makecallback("ShowTurretMenuCb")
new szTurretIndex[4];
num_to_str(iTurretIndex, szTurretIndex, 3)
switch(iTurretType)
{
case TURRET_BULLET: formatex(szFormat, 128, "Купить %d патронов [%d золота]", g_ConfigValues[CFG_TURRET_BULLET_AMMO_NUM], g_ConfigValues[CFG_TURRET_BULLET_AMMO_COST])
case TURRET_LASER: formatex(szFormat, 128, "Купить %d патронов [%d золота]", g_ConfigValues[CFG_TURRET_LASER_AMMO_NUM], g_ConfigValues[CFG_TURRET_LASER_AMMO_COST])
case TURRET_LIGHTING: formatex(szFormat, 128, "Купить %d патронов за [%d золота]", g_ConfigValues[CFG_TURRET_LIGHTING_AMMO_NUM], g_ConfigValues[CFG_TURRET_LIGHTING_AMMO_COST])
case TURRET_MULTI_LASER:formatex(szFormat, 128, "Купить %d патронов за [%d золота]", g_ConfigValues[CFG_TURRET_M_LASER_AMMO_NUM], g_ConfigValues[CFG_TURRET_M_LASER_AMMO_COST])
case TURRET_ROCKET: formatex(szFormat, 128, "Купить %d патронов [%d золота]", g_ConfigValues[CFG_TURRET_ROCKET_AMMO_NUM], g_ConfigValues[CFG_TURRET_ROCKET_AMMO_COST])
case TURRET_GATLING: formatex(szFormat, 128, "Купить %d патронов [%d золота]", g_ConfigValues[CFG_TURRET_GATLING_AMMO_NUM], g_ConfigValues[CFG_TURRET_GATLING_AMMO_COST])
}
// 0
menu_additem(iMenu, szFormat, szTurretIndex, _, cb);
// 1
menu_additem(iMenu, "Удалить турель", _, _, cb);
// 2
formatex(szFormat, 64, "Переместить [%d золота]", g_ConfigValues[CFG_TURRET_MOVE_COST])
menu_additem(iMenu, szFormat, _, _, cb)
// 3
formatex(szFormat, 64, "Переименовать [%d золота]", g_ConfigValues[CFG_TURRET_CHANGE_NAME_COST])
menu_additem(iMenu, szFormat, _, _, cb)
// 4
if(g_IsTurretUpgrading[id][iTurretIndex])
menu_additem(iMenu, "Находится в фазе конфигурации", _, _, cb);
else
menu_additem(iMenu, "Прокачать турель", _, _, cb);
}
menu_display(id, iMenu);
set_task(0.1, "reset", id + 7192);
return PLUGIN_CONTINUE
}
public ShowTurretMenuCb2(id, menu, item)return ITEM_DISABLED;
public ShowTurretMenuH2(id,menu)menu_destroy(menu);