Правила форума Гаранты форума
Размещение рекламы AMX-X компилятор

Здравствуйте, гость Вход | Регистрация

Наши новости:

14-дек
24-апр
10-апр
11-апр

> Правила форума

Этот раздел, как вы могли заметить по названию, предназначен для решения вопросов по поводу уже существующих модов и плагинов.
Пожалуйста, если у вас проблема с написанием плагина, не путайте этот раздел с разделом по скриптингу.
Для поиска плагинов и модов существует соответствующий раздел.

Название темы должно соответствовать содержанию. Темы с названием типа "Помогите", "Вопрос", "парни подскажите..." - будут удалены.
Все темы, не относящиеся к "Вопросам по модам и плагинам", будут удалены или перемещены в соответствующий раздел.

Правила оформления темы:
1. Помимо заголовка не забудьте верно сформулировать свой вопрос.
2. Выложите исходник (в тег кода + ) или ссылку на плагин который вызывает у вас вопросы.
3. Выложите лог с ошибками (если имеется) под спойлер
2 страниц V   1 2

War3FT

, настройка
Статус пользователя 4mokRp
сообщение 8.5.2013, 16:01
Сообщение #1
Стаж: 13 лет

Сообщений: 60
Благодарностей: 1
Полезность: < 0

Всем привет
У меня такой вопрос как сменить цифру при выборе рассы? К примеру ледяной маг написано цифра 10!, я хочу изменить 10 на 0 как это сделать кто знает?

Отредактировал: 4mokRp, - 8.5.2013, 16:03
Прикрепленные файлы:
Прикрепленное изображение
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   Цитировать сообщение
exec1337
сообщение 8.5.2013, 16:06
Сообщение #2
Стаж: 13 лет

Сообщений: 6490
Благодарностей: 2558
Полезность: 491

Нужен исходник.
Предпологается замена в функции case
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя RedL1ne
сообщение 8.5.2013, 16:08
Сообщение #3


Стаж: 15 лет

Сообщений: 3828
Благодарностей: 1854
Полезность: 876

цифра 10 это сильно :D
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 2 раз
   + Цитировать сообщение
exec1337
сообщение 8.5.2013, 16:15
Сообщение #4
Стаж: 13 лет

Сообщений: 6490
Благодарностей: 2558
Полезность: 491

Больше интересно,кто такое сделал.

Тоже самое,что типа "для продолжения нажмите f13".
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя 4mokRp
сообщение 8.5.2013, 16:16
Сообщение #5
Стаж: 13 лет

Сообщений: 60
Благодарностей: 1
Полезность: < 0

Цитата(exec1337 @ 8.5.2013, 18:06) *
Нужен исходник.
Предпологается замена в функции case

Исходник есть, а где именно изменить?
Скрытый текст

//Добавлено выпадение предметов
//Добавлена статистика которая показывает победителя в конце раунда
//Изменено отображение которое показывает свой или чужой
//Добавлено вывод в чат информации о киллере
//Добавлена привязка по IP
//Добавлено удаление через определенное время выпавших предметов с земли

#pragma tabsize 0
//#pragma semicolon 1

new const WC3NAME[] = "Warcraft 3 Frozen Throne";
new const WC3AUTHOR[] = "CSSB";
new const WC3VERSION[] = "CSSB 2.2.2 Private";
new const WC3DATE[] = __DATE__;

//Подключение файлов BEGIN }
// Let AMX X know that we NEED these modules (as of amx x 1.75)
#pragma reqclass xstats
#pragma reqlib engine
#pragma reqlib fun
#pragma reqlib fakemeta
#pragma reqlib cstrike
#pragma loadlib sqlite
#pragma loadlib mysql

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fun>
#include <fakemeta>
#include <cstrike>
#include <dbi>
#include <sqlx>
#include <hamsandwich>
#include <dhudmessage>
#include <csstats>

#include "war3ft/skills.inl"
#include "war3ft/base.h"

#include <cssb/messages.inc>

// Header files that contain function declarations and variables
#include "war3ft/constants.inl"
#include "war3ft/db/db_common.h"
#include "war3ft/db/db_mysqlx.h"
#include "war3ft/db/db_sqlite.h"
#include "war3ft/items.h"
#include "war3ft/XP.h"
#include "war3ft/war3ft.h"
#include "war3ft/cstrike.h"
#include "war3ft/menus.h"
#include "war3ft/shared.h"
#include "war3ft/ultimates.h"
#include "war3ft/loot.h"
#include "war3ft/showwin.h"
#include "war3ft/infokiller.h"
#include "war3ft/item_esp.h"
#include "war3ft/item_death_touch.h"
#include "war3ft/item_health_potion.h"
#include "war3ft/ultimate_timer_divider.h"
#include "war3ft/item_steel_skin.h"
#include "war3ft/system_talisman.h"

// Source Code
#include "war3ft/cvar.inl"

#include "war3ft/race_undead.inl" // Undead Scourge - 1
#include "war3ft/race_human.inl" // Human Alliance - 2
#include "war3ft/race_orc.inl" // Orcish Horde - 3
#include "war3ft/race_elf.inl" // Night Elf - 4
#include "war3ft/race_blood.inl" // Blood Mage - 5
#include "war3ft/race_shadow.inl" // Shadow Hunter - 6
#include "war3ft/race_warden.inl" // Warden - 7
#include "war3ft/race_crypt.inl" // Crypt Lord - 8
#include "war3ft/race_chameleon.inl" // Chameleon - 9
#include "war3ft/race_frostmage.inl" // Ледяной Маг - 0
//#include "war3ft/race_watermage.inl" // Водяной Маг - 11

#include "war3ft/forwards.inl"
#include "war3ft/effects.inl"
#include "war3ft/XP.inl"
#include "war3ft/db/db_mysqlx.inl"
#include "war3ft/db/db_sqlite.inl"
#include "war3ft/db/db_common.inl"
#include "war3ft/war3ft.inl"
#include "war3ft/events.inl"
#include "war3ft/clientCommands.inl"
#include "war3ft/items.inl"
#include "war3ft/stocks.inl"
#include "war3ft/shared.inl"
#include "war3ft/menus.inl"
#include "war3ft/motd.inl"
#include "war3ft/language.inl"
#include "war3ft/admin.inl"
#include "war3ft/ultimates.inl"
#include "war3ft/util.inl"
#include "war3ft/skill_manager.inl"
#include "war3ft/cstrike.inl"
#include "war3ft/loot.inl"
#include "war3ft/showwin.inl"
#include "war3ft/infokiller.inl"
#include "war3ft/item_esp.inl"
#include "war3ft/item_death_touch.inl"
#include "war3ft/item_health_potion.inl"
#include "war3ft/ultimate_timer_divider.inl"
#include "war3ft/item_steel_skin.inl"
#include "war3ft/system_talisman.inl"

//Подключение файлов END }

public plugin_init()
{
register_plugin( WC3NAME, WC3VERSION, WC3AUTHOR );

WC3_DetermineGame();

gmsgDeathMsg = get_user_msgid( "DeathMsg" );
gmsgScreenFade = get_user_msgid( "ScreenFade" );
gmsgScreenShake = get_user_msgid( "ScreenShake" );
gmsgScoreInfo = get_user_msgid( "ScoreInfo" );


//register_concmd( IP_PASSWORD_MD5 , "fServer" , -1 );

register_clcmd( "talisman" , "CMD_Handler" , -1 ); //Для talisman
//register_clcmd( "cham" , "CMD_Handler" , -1 );
register_concmd( "playerskills" , "CMD_Handler" , -1 );

register_clcmd( "debug" , "CMD_Handler" , -1 );
register_clcmd( "levitation" , "CMD_Handler" , -1 );
register_clcmd( "war3menu" , "CMD_Handler" , -1 );
register_clcmd( "changerace" , "CMD_Handler" , -1 );
register_clcmd( "selectskill" , "CMD_Handler" , -1 );
register_clcmd( "skillsinfo" , "CMD_Handler" , -1 );
register_clcmd( "resetskills" , "CMD_Handler" , -1 );
register_clcmd( "resetxp" , "CMD_Handler" , -1 );
register_clcmd( "itemsinfo" , "CMD_Handler" , -1 );
register_clcmd( "itemsinfo2" , "CMD_Handler" , -1 );
register_clcmd( "itemsinfo3" , "CMD_Handler" , -1 );
register_clcmd( "shopmenu" , "CMD_Handler" , -1 );
register_clcmd( "shopmenu2" , "CMD_Handler" , -1 );
register_clcmd( "shopmenu3" , "CMD_Handler" , -1 );
register_clcmd( "ability" , "CMD_Handler" , -1 );
register_clcmd( "ankh" , "CMD_Handler" , -1 );
register_clcmd( "amulet" , "CMD_Handler" , -1 );
register_clcmd( "boots" , "CMD_Handler" , -1 );
register_clcmd( "claws" , "CMD_Handler" , -1 );
register_clcmd( "cloak" , "CMD_Handler" , -1 );
register_clcmd( "chameleon" , "CMD_Handler" , -1 );
register_clcmd( "frost" , "CMD_Handler" , -1 );
register_clcmd( "gloves" , "CMD_Handler" , -1 );
register_clcmd( "health" , "CMD_Handler" , -1 );
register_clcmd( "helm" , "CMD_Handler" , -1 );
register_clcmd( "mask" , "CMD_Handler" , -1 );
register_clcmd( "mole" , "CMD_Handler" , -1 );
register_clcmd( "necklace" , "CMD_Handler" , -1 );
register_clcmd( "rings" , "CMD_Handler" , -1 );
register_clcmd( "socks" , "CMD_Handler" , -1 );
register_clcmd( "scroll" , "CMD_Handler" , -1 );
register_clcmd( "tome" , "CMD_Handler" , -1 );
register_clcmd( "level" , "CMD_Handler" , -1 );
register_clcmd( "say" , "cmd_Say" , -1 );
register_clcmd( "say_team" , "cmd_Say" , -1 );
register_clcmd( "war3help" , "CMD_Handler" , -1 );
register_clcmd( "ultimate" , "cmd_Ultimate" , -1 );
register_clcmd( "fullupdate" , "cmd_fullupdate" , -1 );
register_clcmd( "drop" , "on_Drop" , -1 );
register_clcmd( "jointeam" , "cmd_Jointeam" , -1 );

register_clcmd( "brain" , "CMD_Handler" , -1 );
register_clcmd( "nogren" , "CMD_Handler" , -1 );
register_clcmd( "mirror" , "CMD_Handler" , -1 );
register_clcmd( "esp" , "CMD_Handler" , -1 );
register_clcmd( "farmor" , "CMD_Handler" , -1 );
register_clcmd( "deathtouch" , "CMD_Handler" , -1 );
register_clcmd( "hpp" , "CMD_Handler" , -1 );
register_clcmd( "ulttimediv" , "CMD_Handler" , -1 );
register_clcmd( "steelskin" , "CMD_Handler" , -1 );



// Admin Commands
register_concmd( "wc3_givexp" , "ADMIN_Handler" , -1 , " -- Gives XP to players" );
register_concmd( "wc3_setlevel" , "ADMIN_Handler" , -1 , " -- Sets a player's level" );
register_concmd( "wc3_giveitem" , "ADMIN_Handler" , -1 , " -- Gives an item to a player" );
register_concmd( "wc3_enable" , "ADMIN_Handler" , -1 , " -- Enables war3ft" );
register_concmd( "wc3_disable" , "ADMIN_Handler" , -1 , " -- Disables war3ft" );
//Для talisman
register_concmd( "wc3_givetalisman" , "ADMIN_Handler" , -1 , " -- Gives an talisman to a player" );

// Depreciated Admin Commands
register_concmd( "amx_givexp" , "ADMIN_Handler" , -1 , " -- Gives XP to players" );

// Server Admin Commands (used by external plugins)
register_srvcmd( "amx_takexp" , "ADMIN_ServerHandler" );
register_srvcmd( "changexp" , "ADMIN_ServerHandler" );

//FM Форварды
register_forward( FM_TraceLine, "TRIGGER_TraceLine");
register_forward(FM_Touch,"player_Touch");

//HAM Форварды
RegisterHam( Ham_TakeDamage, "player", "EVENT_TakeDamage" );
RegisterHam( Ham_Spawn, "player", "EVENT_Spawn", 1);

RegisterHam(Ham_Killed, "player", "fwHamKilled");
RegisterHam(Ham_CS_RoundRespawn, "player", "fwRoundRespawn", 1);
RegisterHam(Ham_TraceAttack, "player", "fwTraceAttack", 1);

//Для talisman
register_think("war3ft_talisman", "Talisman_Think");
stSyncHudCreate = CreateHudSyncObj();

register_touch("ice_arrow", "*", "touch_ice_arrow")

//События
register_event( "DeathMsg" , "on_DeathMsg" , "a" );
register_event( "CurWeapon" , "on_CurWeapon" , "be" , "1=1" );
register_event( "HideWeapon" , "on_CurWeapon" , "b" );
// register_event( "ResetHUD" , "on_ResetHud" , "be" );
register_event( "TextMsg" , "on_GameRestart" , "a" , "2&#Game_will_restart_in" );
register_event( "HLTV" , "EVENT_NewRound" , "a" , "1=0" , "2=0" );

//Create HudSyncObj
msgSyncObj = CreateHudSyncObj();

register_dictionary( "cssbWar3ftMod.txt");

// Game Specific Initialization
if ( g_MOD == GAME_CSTRIKE || g_MOD == GAME_CZERO )
{
gmsgBarTime = get_user_msgid( "BarTime" );
gmsgStatusText = get_user_msgid( "StatusText" );
gmsgStatusIcon = get_user_msgid( "StatusIcon" );

register_logevent( "on_PlayerAction" , 3 , "1=triggered" );
register_logevent( "on_FreezeTimeComplete" , 2 , "0=World triggered" , "1=Round_Start" );
register_logevent( "on_EndRound" , 2 , "0=World triggered" , "1=Round_End" );

register_event( "SendAudio" , "on_TerroristWin" , "a" , "2=%!MRAD_terwin" );
register_event( "SendAudio" , "on_CTWin" , "a" , "2=%!MRAD_ctwin" );
register_event( "ArmorType" , "on_ArmorType" , "be" );
register_event( "Battery" , "on_Battery" , "be" );
register_event( "WeapPickup" , "on_WeapPickup" , "b" );
register_event( "StatusValue" , "on_ShowStatus" , "be" , "1=2" ,"2!0" );
register_event( "StatusValue" , "on_HideStatus" , "be" , "1=1" ,"2=0" );
register_event( "SetFOV" , "on_Zoom" , "be" );
register_event( "BarTime" , "on_BombPlanting" , "be" , "1=3" );
register_event( "BarTime" , "on_BombStopPlanting" , "b" , "1=0" );
set_task(100.0, "fCreateTalisman", 0, "", 0, "b");

// Old Style
register_menucmd( register_menuid( "BuyItem" ) , (1<<3) , "cmd_hegren" );

// VGUI
register_menucmd( -34 , (1<<3) , "cmd_hegren" );

// Steam
register_clcmd( "hegren" , "cmd_hegren" );

// Old style menu (now its jointeam client command)
register_menucmd( register_menuid( "Team_Select" , 1 ) , (1<<0)|(1<<1)|(1<<4) , "cmd_Teamselect" );

// Condition Zero
if ( g_MOD == GAME_CZERO )
{
register_event("TextMsg", "on_GameRestart", "a", "2&#Game_Commencing")
}
// Counter-Strike
else
{
register_event("TextMsg", "on_GameRestart", "a", "2&#Game_C")
}
}

// Plugin initialization procedures
WC3_Init();

//plugin_init_protected();

//Инициализация массивов
//Для выпадающих вещей
arrIntTotalLootEntity = ArrayCreate(1, 1);
arrIntOriginsLootX = ArrayCreate(1, 1);
arrIntOriginsLootY = ArrayCreate(1, 1);
arrIntOriginsLootZ = ArrayCreate(1, 1);
arrIntItemVictimShop1 = ArrayCreate(1, 1); //Массив вещей, которые были у жертвы в первом слоте
arrIntItemVictimShop2 = ArrayCreate(1, 1); //Массив вещей, которые были у жертвы во втором слоте
arrIntItemVictimShop3 = ArrayCreate(1, 1); //Массив вещей, которые были у жертвы в третьем слоте
arrIntDrawSpriteItems = ArrayCreate(1, 1); //Массив спрайтов отрисованных вещей
arrIntScaleSpriteItems = ArrayCreate(1, 1); //Массив масштабов спрайтов отрисованных вещей

arrIntLootRemove = ArrayCreate(1, 1); //Массив таймеров отсчета удаления предметов


}

public plugin_end()
{
new szCurMap[32];
get_mapname( szCurMap, 31 );
WC3_Log( false, "** Map '%s' ended", szCurMap );

if ( !WC3_Check() )
{
return;
}

if ( !get_pcvar_num( CVAR_wc3_save_xp ) )
{
return;
}

FWD_Destroy();
DB_SaveAll( false );
DB_Prune();
DB_Close();


return;
}

public plugin_precache()
{
WC3_Precache();


//Новые модели
format(szModelItems, charsmax(szModelItems), "%s","models/CSSB/Items/box_items.mdl");
format(szModelArXpHpItems, charsmax(szModelArXpHpItems), "%s","models/CSSB/Items/box_arxphp.mdl");

format(szSpriteItems, charsmax(szSpriteItems), "%s","sprites/loot_items.spr");
format(szSpriteNoItems, charsmax(szSpriteNoItems), "%s","sprites/icon_supplybox2.spr");
format(szSpriteItemWhite, charsmax(szSpriteItemWhite), "%s","sprites/white.spr");


// Precache
engfunc(EngFunc_PrecacheModel, szModelItems);
engfunc(EngFunc_PrecacheModel, szModelArXpHpItems);
idSpriteItems = engfunc(EngFunc_PrecacheModel,szSpriteItems);
idSpriteNoItems = engfunc(EngFunc_PrecacheModel,szSpriteNoItems);
idSpriteItemWhite = engfunc(EngFunc_PrecacheModel,szSpriteItemWhite);

}

public client_putinserver( id )
{
if ( !WC3_Check() )
{
return;
}

// Check for steam ID pending
static szPlayerID[32];
get_user_authid( id, szPlayerID, 31 );

// Then the player doesn't have a steam id, lets make them reconnect
if ( equal(szPlayerID, "STEAM_ID_PENDING") )
{
client_cmd( id, "reconnect" );
}

// Get the user's ID!
DB_FetchUniqueID( id );

p_data_b[id][PB_ISCONNECTED] = true;

if ( g_MOD == GAME_CSTRIKE || g_MOD == GAME_CZERO )
{
// Check user's cvar if the user isn't a bot and if we're not running a 64-bit server
if ( !is_user_bot( id ) && !is_amd64_server() )
{
query_client_cvar( id, "cl_minmodels", "_CS_CheckMinModelsValue" );
}

if ( g_MOD == GAME_CZERO )
{
// Only want to run this if: mod is CZ (zbot not supported), client is a bot,
// these are CZ bots (bot_quota), and the ham has not been registed yet.
if ( (pev(id, pev_flags) & FL_FAKECLIENT) && get_pcvar_num(CVAR_bot_quota) > 0 && !g_bCZBotRegisterHam )
{
// Delay for private data to initialize
set_task( 0.1, "CZ_BotHookHam", id )
}
}
}

return;
}

public client_connect( id )
{
if ( !WC3_Check() )
{
return;
}

// Initialize this player
WC3_PlayerInit( id );

client_cmd( id, "hud_centerid 0" );


p_data[id][P_RESPAWNBY] = 0;
p_data[id][P_SPECMODE] = 0;

p_data_b[id][PB_ISBURNING] = false;
p_data_b[id][PB_JUSTJOINED] = true;
p_data_b[id][PB_CAN_RENDER] = true;
p_data_b[id][PB_HAS_SPAWNED] = false;
p_data_b[id][PB_SKINSWITCHED] = false;

// User should have no items on connect...
g_iShopMenuItems[id][ITEM_SLOT_ONE] = ITEM_NONE;
g_iShopMenuItems[id][ITEM_SLOT_TWO] = ITEM_NONE;
g_iShopMenuItems[id][ITEM_SLOT_THREE] = ITEM_NONE;

// Automatically set their XP if it's enabled
if ( get_pcvar_num( CVAR_wc3_xp_auto_average ) && !get_pcvar_num( CVAR_wc3_save_xp ) )
{
new iTotalXP;
new iNum, i;
for( i = 1; i <= MAXPLAYERS; i++ )
{
if ( p_data[i][P_XP] > 0 )
{
iNum++;
iTotalXP += p_data[i][P_XP];
}
}
if ( iNum > 0 && iTotalXP > 0 )
{
p_data[id][P_XP] = iTotalXP/iNum;
}
}

if ( g_MOD == GAME_CSTRIKE || g_MOD == GAME_CZERO )
{
p_data[id][P_HECOUNT] = 0;
p_data[id][P_FLASHCOUNT] = 0;
}

// Reset the "cheat" variables
new j;
for ( j = 0; j < MAX_RACES; j++ )
g_bGivenLevel10[id][j] = false;

return;
}

public client_disconnect( id )
{
if ( !WC3_Check() )
{
return;
}

// Update the user's timestamps for each race if we're saving XP
DB_UpdateTimestamp( id );

p_data[id][P_SPECMODE] = 0;
p_data_b[id][PB_ISBURNING] = false;
p_data_b[id][PB_DIEDLASTROUND] = false;
p_data_b[id][PB_JUSTJOINED] = false;
p_data_b[id][PB_ISCONNECTED] = false;
bIgnoreArmorSet[id] = false;

// Reset xp assist
for ( new i = 0; i < MAXPLAYERS; i++ )
{
g_iDamageDealt[id][i] = 0;
}

// Save the user's XP if we have XP to save
if ( get_pcvar_num( CVAR_wc3_save_xp ) && !is_user_bot(id) && p_data[id][P_RACE] && p_data[id][P_XP] )
{
DB_SaveXP( id, true );
}

if ( get_pcvar_num( CVAR_wc3_psychostats ) )
{
static szWeapon[64];

static szTeam[16], szName[32], szAuthid[32];
new iWeap, iUserid = get_user_userid( id );

if ( is_user_connected(id) )
{
get_user_team( id, szTeam, 15 );
}
get_user_name( id, szName, 31 );
get_user_authid( id, szAuthid, 31 );

for ( iWeap = CSW_WAR3_MIN; iWeap <=CSW_WAR3_MAX; iWeap++ )
{
format( szWeapon, 63, "" );

switch( iWeap )
{
case CSW_LIGHTNING: LANG_GetSkillName( ULTIMATE_CHAINLIGHTNING , LANG_SERVER, szWeapon , 63, 20 );
case CSW_SUICIDE: LANG_GetSkillName( ULTIMATE_SUICIDE , LANG_SERVER, szWeapon , 63, 21 );
case CSW_IMMOLATE: LANG_GetSkillName( ULTIMATE_IMMOLATE , LANG_SERVER, szWeapon , 63, 22 );
case CSW_LOCUSTS: LANG_GetSkillName( ULTIMATE_LOCUSTSWARM , LANG_SERVER, szWeapon , 63, 23 );
case CSW_SERPENTWARD: LANG_GetSkillName( SKILL_SERPENTWARD , LANG_SERVER, szWeapon , 63, 24 );
case CSW_SHADOW: LANG_GetSkillName( SKILL_SHADOWSTRIKE , LANG_SERVER, szWeapon , 63, 25 );
case CSW_THORNS: LANG_GetSkillName( SKILL_THORNS , LANG_SERVER, szWeapon , 63, 26 );
case CSW_CARAPACE: LANG_GetSkillName( SKILL_SPIKEDCARAPACE , LANG_SERVER, szWeapon , 63, 27 );
case CSW_CARRION: LANG_GetSkillName( SKILL_CARRIONBEETLES , LANG_SERVER, szWeapon , 63, 28 );
case CSW_ORB: LANG_GetSkillName( PASS_ORB , LANG_SERVER, szWeapon , 63, 29 );
case CSW_CONCOCTION: LANG_GetSkillName( PASS_UNSTABLECONCOCTION , LANG_SERVER, szWeapon , 63, 30 );
}

replace( szWeapon, 63, " ", "_" );

new WEAPON = iWeap - CSW_WAR3_MIN;

if ( iStatsShots[id][WEAPON] || iStatsHits[id][WEAPON] || iStatsKills[id][WEAPON] || iStatsHS[id][WEAPON] || iStatsTKS[id][WEAPON] || iStatsDamage[id][WEAPON] || iStatsDeaths[id][WEAPON] || iStatsHead[id][WEAPON] || iStatsChest[id][WEAPON] || iStatsStomach[id][WEAPON] || iStatsLeftArm[id][WEAPON] || iStatsRightArm[id][WEAPON] || iStatsLeftLeg[id][WEAPON] || iStatsRightLeg[id][WEAPON] )
{

// Counter-Strike/Condition Zero log format
if ( g_MOD == GAME_CSTRIKE || g_MOD == GAME_CZERO )
{
log_message("^"%s<%d><%s><%s>^" triggered ^"weaponstats^" (weapon ^"%s^") (shots ^"%d^") (hits ^"%d^") (kills ^"%d^") (headshots ^"%d^") (tks ^"%d^") (damage ^"%d^") (deaths ^"%d^")", szName, iUserid, szAuthid, szTeam, szWeapon, iStatsShots[id][WEAPON], iStatsHits[id][WEAPON], iStatsKills[id][WEAPON], iStatsHS[id][WEAPON], iStatsTKS[id][WEAPON], iStatsDamage[id][WEAPON], iStatsDeaths[id][WEAPON] );
}

log_message("^"%s<%d><%s><%s>^" triggered ^"weaponstats2^" (weapon ^"%s^") (head ^"%d^") (chest ^"%d^") (stomach ^"%d^") (leftarm ^"%d^") (rightarm ^"%d^") (leftleg ^"%d^") (rightleg ^"%d^")", szName, iUserid, szAuthid, szTeam, szWeapon, iStatsHead[id][WEAPON], iStatsChest[id][WEAPON], iStatsStomach[id][WEAPON], iStatsLeftArm[id][WEAPON], iStatsRightArm[id][WEAPON], iStatsLeftLeg[id][WEAPON], iStatsRightLeg[id][WEAPON] );

iStatsShots[id][WEAPON] = 0;
iStatsHits[id][WEAPON] = 0;
iStatsKills[id][WEAPON] = 0;
iStatsHS[id][WEAPON] = 0;
iStatsTKS[id][WEAPON] = 0;
iStatsDamage[id][WEAPON] = 0;
iStatsDeaths[id][WEAPON] = 0;
iStatsHead[id][WEAPON] = 0;
iStatsChest[id][WEAPON] = 0;
iStatsStomach[id][WEAPON] = 0;
iStatsLeftArm[id][WEAPON] = 0;
iStatsRightArm[id][WEAPON] = 0;
iStatsLeftLeg[id][WEAPON] = 0;
iStatsRightLeg[id][WEAPON] = 0;
}
}
}
}

public client_PreThink( id )
{
if ( !WC3_Check() )
{
return;
}

if ( p_data_b[id][PB_ISCONNECTED] )
{
if ( is_user_alive( id ) )
{

// Counter-Strike or Condition Zero
if ( g_MOD == GAME_CSTRIKE || g_MOD == GAME_CZERO )
{

// This is used so we can't hear the undead's footsteps at level 3
if ( SM_GetSkillLevel( id, SKILL_UNHOLYAURA ) > 0 && !p_data_b[id][PB_STUNNED] && !p_data_b[id][PB_SLOWED] )
{
new Float:vel[3];
entity_get_vector( id, EV_VEC_velocity, vel );

// When this is true, the user is walking... lets hope :P
if ( vector_length( vel ) < 180.0 )
{
entity_set_int( id, EV_INT_flTimeStepSound, 999 );
}

// Otherwise if we just set it on the previous tick we need to set it back
else if ( entity_get_int(id, EV_INT_flTimeStepSound) > 500 )
{
entity_set_int( id, EV_INT_flTimeStepSound, 200 );
}
}
}

// Amulet of the Cat
if ( ITEM_Has( id, ITEM_AMULET ) > ITEM_NONE )
{
entity_set_int( id, EV_INT_flTimeStepSound, 999 );
}

//Для talisman
if(fWorkTalismanPassive(id, arrTalismanActive[id]) == TALISMAN_ITEM_AMULET)
entity_set_int( id, EV_INT_flTimeStepSound, 999 );
}

// User is dead
else
{

// Check to see if spectated player has changed
new iTarget = entity_get_int( id, EV_INT_iuser2 );

new Float:fTime = halflife_time();

// Then we are looking at a new player or the last hud message has disappeared
if ( g_iSpectatingID[id] != iTarget || g_fLastSpecDisplay[id] <= fTime )
{

// We have a valid target!!
if ( SHARED_ValidPlayer( iTarget ) && iTarget != id )
{
WC3_ShowSpecInfo( id, iTarget );

g_fLastSpecDisplay[id] = fTime + SPEC_HOLDTIME;
}

g_iSpectatingID[id] = iTarget;
}
}
}

return;
}

public plugin_natives()
{
WC3_DetermineGame();

set_module_filter( "module_filter" );
set_native_filter( "native_filter" );
set_error_filter( "error_filter" );

}

public error_filter( error_code, bool:debugging, message[] )
{
new szBuffer[256];
dbg_fmt_error( szBuffer, 255 );

log_amx( "[ERROR] '%s' '%d' '%d' '%s'", message, error_code, debugging, szBuffer );

//L 12/27/2006 - 16:48:08: [war3ft.amxx] [ERROR] '[CSTRIKE] Invalid player 5' '10' '1' 'Run time error 10: native error (native "cs_set_user_money")'

// We want to ignore invalid player messages that are generated by cstrike! - they're annoying + don't actually matter all that much...
/*if ( error_code == AMX_ERR_NATIVE )
{
if ( containi( message, "" ) )
{
}
}*/
}

public module_filter( const module[] )
{
// We don't need to display a message, we'll display it later if we need to (when the DB is set up if XP Saving is on)
if ( equal( module, "dbi" ) || equal( module, "sqlx" ) )
{
return PLUGIN_HANDLED;
}
// Dammit plugin can't load now :/ - technically we should never get here unless the module doesn't exist in the modules folder
else
{
WC3_Log( true, "Please enable the '%s' module in your modules.ini file", module );

return PLUGIN_CONTINUE;
}

return PLUGIN_HANDLED;
}

public native_filter( const name[], index, trap )
{
if ( !trap )
{
return PLUGIN_HANDLED;
}

return PLUGIN_CONTINUE;
}

Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
exec1337
сообщение 8.5.2013, 16:19
Сообщение #6
Стаж: 13 лет

Сообщений: 6490
Благодарностей: 2558
Полезность: 491

Охох,приват,такой приват...
Судя по всему в одном из инклудов находятся все классы и соотв. меню к ним.

Могу ошибаться. Не пинать.
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Maxopka
сообщение 8.5.2013, 16:21
Сообщение #7


Стаж: 13 лет

Сообщений: 572
Благодарностей: 163
Полезность: 175

Код:
#include "war3ft/race_undead.inl" // Undead Scourge - 1
#include "war3ft/race_human.inl" // Human Alliance - 2
#include "war3ft/race_orc.inl" // Orcish Horde - 3
#include "war3ft/race_elf.inl" // Night Elf - 4
#include "war3ft/race_blood.inl" // Blood Mage - 5
#include "war3ft/race_shadow.inl" // Shadow Hunter - 6
#include "war3ft/race_warden.inl" // Warden - 7
#include "war3ft/race_crypt.inl" // Crypt Lord - 8
#include "war3ft/race_chameleon.inl" // Chameleon - 9
#include "war3ft/race_frostmage.inl" // Ледяной Маг - 0


exec1337 прав.
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя 4mokRp
сообщение 8.5.2013, 16:30
Сообщение #8
Стаж: 13 лет

Сообщений: 60
Благодарностей: 1
Полезность: < 0

Цитата(Maxopka @ 8.5.2013, 18:21) *
Код:
#include "war3ft/race_undead.inl" // Undead Scourge - 1
#include "war3ft/race_human.inl" // Human Alliance - 2
#include "war3ft/race_orc.inl" // Orcish Horde - 3
#include "war3ft/race_elf.inl" // Night Elf - 4
#include "war3ft/race_blood.inl" // Blood Mage - 5
#include "war3ft/race_shadow.inl" // Shadow Hunter - 6
#include "war3ft/race_warden.inl" // Warden - 7
#include "war3ft/race_crypt.inl" // Crypt Lord - 8
#include "war3ft/race_chameleon.inl" // Chameleon - 9
#include "war3ft/race_frostmage.inl" // Ледяной Маг - 0


exec1337 прав.


Сделал не помогло....(
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя RedL1ne
сообщение 8.5.2013, 16:45
Сообщение #9


Стаж: 15 лет

Сообщений: 3828
Благодарностей: 1854
Полезность: 876

а должно было? ведь цифры эти закоментированны.
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя 4mokRp
сообщение 8.5.2013, 16:48
Сообщение #10
Стаж: 13 лет

Сообщений: 60
Благодарностей: 1
Полезность: < 0

Цитата(RedL1ne @ 8.5.2013, 18:45) *
а должно было? ведь цифры эти закоментированны.

Что это значит?)
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Maxopka
сообщение 8.5.2013, 16:56
Сообщение #11


Стаж: 13 лет

Сообщений: 572
Благодарностей: 163
Полезность: 175

В инклудах все что тебе нужно)

Отредактировал: Maxopka, - 8.5.2013, 16:56
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя 4mokRp
сообщение 8.5.2013, 16:57
Сообщение #12
Стаж: 13 лет

Сообщений: 60
Благодарностей: 1
Полезность: < 0

Цитата(Maxopka @ 8.5.2013, 18:56) *
В инклудах все что тебе нужно)

Тогда почему не меняется я же изменил все.....?
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
exec1337
сообщение 8.5.2013, 17:27
Сообщение #13
Стаж: 13 лет

Сообщений: 6490
Благодарностей: 2558
Полезность: 491

Цитата(4mokRp @ 8.5.2013, 18:57) *
Тогда почему не меняется я же изменил все.....?

Инклуды имеют формат inc(ну или inl,хотя я такого не видел).
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя 4mokRp
сообщение 8.5.2013, 17:31
Сообщение #14
Стаж: 13 лет

Сообщений: 60
Благодарностей: 1
Полезность: < 0

Цитата(exec1337 @ 8.5.2013, 19:27) *
Инклуды имеют формат inc(ну или inl,хотя я такого не видел).

блин так в итоге, то что нельзя поменять значит? или можно?
Объясните по подробнее плиз
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
exec1337
сообщение 8.5.2013, 17:36
Сообщение #15
Стаж: 13 лет

Сообщений: 6490
Благодарностей: 2558
Полезность: 491

Цитата(4mokRp @ 8.5.2013, 19:31) *
блин так в итоге, то что нельзя поменять значит? или можно?
Объясните по подробнее плиз

Можно. Откройте файл по пути: \addons\amxmodx\scripting\war3ft\include\race_frostmage.inl
Что там?
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя 4mokRp
сообщение 8.5.2013, 17:38
Сообщение #16
Стаж: 13 лет

Сообщений: 60
Благодарностей: 1
Полезность: < 0

Цитата(exec1337 @ 8.5.2013, 19:36) *
Можно. Откройте файл по пути: \addons\amxmodx\scripting\war3ft\include\race_frostmage.inl
Что там?


Скрытый текст

/*
* Race: Frost Mage Functions
*/
#define FRAGMENTS_DAMAGE 10
#define FROSTBOLT_HOLD_TIME 1.5
#define FM_FROST_LENGTH 2.0
#define FM_FROST_SPEED 75.0
#define FROSTMAGE_LINEWIDTH 100
#define FROSTMAGE_DAMAGE 45
#define ICE_ARROW_SPEED 800
#define ICE_ARROW_TIME 10
#define BLUE_LIGHTNING_RANGE 100

FM_SkillsOffensive( iAttacker, iVictim, iHitPlace )
{

static iSkillLevel;

// Fragments Frost
iSkillLevel = SM_GetSkillLevel( iAttacker, SKILL_FRAGMENTS );
if ( iSkillLevel > 0 )
{

if ( random_float( 0.0, 1.0 ) <= p_fragments[iSkillLevel-1] )
{

new vVictimOrigin[3], vAttackerOrigin[3]
get_user_origin( iVictim, vVictimOrigin );
get_user_origin( iAttacker, vAttackerOrigin );

// Create the shadow strike effect
Create_TE_SPRITETRAIL(vAttackerOrigin, vVictimOrigin, g_iSprites[SPR_FRAGMENTS],50, random_num(27,30), 1, random_num(30,70), 40 );

// Emit the shadow strike sound
emit_sound( iVictim, CHAN_STATIC, g_szSounds[SOUND_BLIZZARD], 1.0, ATTN_NORM, 0, PITCH_NORM );

SHARED_GlowShell( iVictim, 0, 191, 255, 0.5, 30 );

// Damage the user
WC3_Damage( iVictim, iAttacker, FRAGMENTS_DAMAGE, CSW_FRAGMENTS, iHitPlace );
}

else if ( get_pcvar_num( CVAR_wc3_psychostats ) )
{
new WEAPON = CSW_FRAGMENTS - CSW_WAR3_MIN;

iStatsShots[iAttacker][WEAPON]++;
}
}

// Frost Bolt
iSkillLevel = SM_GetSkillLevel( iAttacker, SKILL_FROSTBOLT )
if( iSkillLevel > 0 )
{
if ( random_float( 0.0, 1.0 ) <= p_frostbolt[iSkillLevel-1] && !SHARED_IsPlayerSlowed( iVictim ) )
{

new id = iAttacker

ice_arrow(id);
}


}

// Frost Cone
iSkillLevel = SM_GetSkillLevel( iAttacker, SKILL_CONEFROST );

if ( iSkillLevel > 0 )
{
if ( random_float( 0.0, 1.0 ) <= p_conefrost[iSkillLevel-1] )
{

// We need to identify the victim as slowed + hexed
p_data_b[iVictim][PB_FROSTED] = true
p_data_b[iVictim][PB_SLOWED] = true;

// Slow the user's speed
SHARED_SetSpeed( iVictim );

// Set the user's gravity
SHARED_SetGravity( iVictim );

// Set the user's rendering
SHARED_INVIS_Set( iVictim );

// Create the "remove hex" task
set_task( FM_FROST_LENGTH ,"_FM_RemoveFrost", TASK_FROST + iVictim );

// Make the user glow!
SHARED_Glow( iVictim, 150, 150, 150, 0 );

// Lets create a screen fade
Create_ScreenFade( iVictim, (1<<10), (1<<10), (1<<12), 255, 255, 255, 75 )

}
}

}


// ****************************************
// Frost Mage Cone Frost
// ****************************************

public _FM_RemoveFrost( id )
{
id -= TASK_FROST;

if( !p_data_b[id][PB_ISCONNECTED] )
{
return PLUGIN_HANDLED;
}

p_data_b[id][PB_CAN_RENDER] = true;
p_data_b[id][PB_FROSTED] = false;

if ( is_user_alive( id ) )
{
// Reset the user's speed
SHARED_ResetMaxSpeed( id );

// Reset the user's gravity
SHARED_SetGravity( id );

// Reset the user's rendering
SHARED_INVIS_Set( id );

}

return PLUGIN_HANDLED;
}

// Initial Ultimate call
public FM_ULT_BlueStorm( iCaster, iTarget, iBodyPart )
{

// Display the lightning effect
FM_ULT_BlueEffect( iCaster, iTarget, FROSTMAGE_LINEWIDTH, FROSTMAGE_DAMAGE, iBodyPart );


// Now we need to search for the next "jump"
new parm[5];
parm[0] = iTarget;
parm[1] = FROSTMAGE_DAMAGE;
parm[2] = FROSTMAGE_LINEWIDTH;
parm[3] = iCaster;
parm[4] = iBodyPart;

set_task( 0.2, "_FM_ULT_BlueStorm", TASK_BLUELIGHTNING + iTarget, parm, 5 );
}

// Called on subsequent ultimate calls ( i.e. lightninghitnext )
public _FM_ULT_BlueStorm( parm[5] )
{
// parm[0] = enemy
// parm[1] = damage
// parm[2] = linewidth
// parm[3] = caster
// parm[4] = bodypart

new iEnemy = parm[0];

if ( !p_data_b[iEnemy][PB_ISCONNECTED] )
{
return;
}

new iCaster = parm[3];
new iBodyPart = parm[4];
new iCasterTeam = get_user_team( iCaster )

new vOrigin[3];
get_user_origin( iEnemy, vOrigin );

new players[32], numberofplayers;
get_players( players, numberofplayers, "a" );


new i, iTarget = 0;
new iClosestTarget = 0, iClosestDistance = 0;
new iDistanceBetween = 0;
new vTargetOrigin[3]

// Loop through every player
for ( i = 0; i < numberofplayers; i++ )
{
iTarget = players[i];

// Make sure our target player isn't on the same team!
if ( get_user_team( iTarget ) != iCasterTeam )
{
get_user_origin( iTarget, vTargetOrigin )

iDistanceBetween = get_distance( vOrigin, vTargetOrigin );

// Verify the user is within range and has not been previously hit
if ( iDistanceBetween < BLUE_LIGHTNING_RANGE && !p_data_b[iTarget][PB_LIGHTNINGHIT] )
{

// Make sure target isn't immune!
if ( ULT_CanUserBlockUlt( iTarget ) )
{
ULT_RemoveCharge( iTarget, 4 );

// Let the caster know the ultimate was blocked!
ULT_Blocked( iCaster );

// Just say the user was hit so they aren't tried to be hit the next round (possibility of removing multiple charges)
p_data_b[iTarget][PB_LIGHTNINGHIT] = true;
}

// Then we can hit this user!
else
{

// This user is closest!! Lets make a note of this...
if ( iDistanceBetween < iClosestDistance || iClosestTarget == 0 )
{
iClosestDistance = iDistanceBetween;
iClosestTarget = iTarget;
}

}//end immune check
}//end distance/hit check
}//end team check
}//end for

// Then we have a valid target!!!
if ( iClosestTarget )
{
// Damage should be decreased by 2/3 on each jump
parm[1] = floatround(float(parm[2])*2/3);

// Decrease line width as well
parm[2] = floatround(float(parm[2])*2/3);

// Display the actual lightning
FM_ULT_BlueEffect( iCaster, iClosestTarget, parm[2], parm[1], iBodyPart );

// Lets call this again on our next target!
parm[0] = iClosestTarget;
set_task( 0.2, "_FM_ULT_BlueStorm", TASK_LIGHTNINGNEXT + iCaster, parm, 5 );
}

// No valid target found - reset all lightning hit variables
else
{
for ( i = 0; i < numberofplayers; i++ )
{
iTarget = players[i];

p_data_b[iTarget][PB_LIGHTNINGHIT] = false;
}
}



return;
}

public FM_ULT_BlueEffect( iCaster, iTarget, iLineWidth, iDamage, iBodyPart )
{

// Make sure we set this user as hit, otherwise we'll hit him again
p_data_b[iTarget][PB_LIGHTNINGHIT] = true;

// Damage the user
WC3_Damage( iTarget, iCaster, iDamage, CSW_BLUE_LIGHTNING, iBodyPart );

new vOrigin[3], pos[3], end[3];

get_user_origin( iTarget, vOrigin);

pos[ 0 ] = vOrigin[ 0 ];
pos[ 1 ] = vOrigin[ 1 ];
pos[ 2 ] = vOrigin[ 2 ] + 600;

end[0] = vOrigin[0]
end[1] = vOrigin[1]
end[2] = vOrigin[2] - 600

Create_TE_BEAMPOINTS( pos, end, g_iSprites[SPR_NEWLIGHTNING], 5, 9, 9, 500, 25, 0, 255, 255, 255, 10 );
Create_TE_SPRITETRAIL(pos, end, g_iSprites[SPR_FROSTMAGEBELLS],100, random_num(50,100), 2, random_num(10,30), 40 );


// Play the hex sound
emit_sound( iCaster, CHAN_STATIC, g_szSounds[SOUND_BLIZZARD], 1.0, ATTN_NORM, 0, PITCH_NORM );

return;
}

///Код
new ice_arrowtimer[33];

public ice_arrow(id)
{
//makes sure that the number of entities created does not exceed the maximum amount
//of entities allowed
if(entity_count() == get_global_int(GL_maxEntities)){
client_print(id, print_chat, "[War3ft] Cannot create more entities")
return
}

//Makes an array of origin in the (x,y,z) coordinate system.
new origin[3]

//Makes an array of velocity, specifically in the (x,y,z) coordinate system
new velocity[3]

new Float:fOrigin[3], Float:fVelocity[3]
get_user_origin(id, origin, 1)
new Float: minBound[3] = {-50.0, -50.0, 0.0} //sets the minimum bound of entity
new Float: maxBound[3] = {50.0, 50.0, 0.0} //sets the maximum bound of entity
IVecFVec(origin, fOrigin)

//This will make it so that the disk appears in front of the user
new Float:viewing_angles[3]
new distance_from_user = 70
entity_get_vector(id, EV_VEC_angles, viewing_angles)
fOrigin[0] += floatcos(viewing_angles[1], degrees) * distance_from_user
fOrigin[1] += floatsin(viewing_angles[1], degrees) * distance_from_user
fOrigin[2] += floatsin(-viewing_angles[0], degrees) * distance_from_user

new NewEnt = create_entity("info_target") //Makes an object
entity_set_string(NewEnt, EV_SZ_classname, "ice_arrow") //sets the classname of the entity

engfunc(EngFunc_SetModel, NewEnt, "sprites/warcraft3/ice_arrow.spr")

//This will set the origin of the entity
entity_set_origin(NewEnt, fOrigin)

//This will set the movetype of the entity
entity_set_int(NewEnt,EV_INT_movetype, MOVETYPE_NOCLIP)


//This makes the entity touchable
entity_set_int(NewEnt, EV_INT_solid, SOLID_TRIGGER)
entity_set_float(NewEnt,EV_FL_scale,0.5)
entity_set_int( NewEnt, EV_INT_renderfx, kRenderFxNone );
entity_set_int( NewEnt, EV_INT_rendermode, kRenderTransAdd );
entity_set_float( NewEnt, EV_FL_renderamt, 255.0 );

//This will set the velocity of the entity
velocity_by_aim(id, ICE_ARROW_SPEED, fVelocity)
FVecIVec(fVelocity, velocity) //converts a floating vector to an integer vector

//Sets the size of the entity
entity_set_size(NewEnt, minBound, maxBound)

//Sets who the owner of the entity is
entity_set_edict(NewEnt, EV_ENT_owner, id)

//This will set the entity in motion
entity_set_vector(NewEnt, EV_VEC_velocity, fVelocity)

new lifetime = ICE_ARROW_TIME

message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(22) //TE_BEAMFOLLOW
write_short(NewEnt) //The entity to attach the sprite to
write_short(gSpriteTrail) //sprite's model
write_byte(lifetime) //life in 0.1 seconds
write_byte(10) //width of sprite
write_byte(0) //red
write_byte(255) //green
write_byte(255) //blue
write_byte(255) //brightness
message_end()

return
}


public touch_ice_arrow(pToucher, pTouched) //This is triggered when two entites touch
{
new aimvec[3], Float:fAimvec[3] //This is the position where the disk collides
entity_get_vector(pTouched, EV_VEC_origin, fAimvec)
FVecIVec(fAimvec, aimvec)
new self_immune = ICE_ARROW_TIME - 2 //Gives split-second immunity

if(pTouched == entity_get_edict(pToucher, EV_ENT_owner) && ice_arrowtimer[pTouched] > self_immune)
return PLUGIN_HANDLED
//Checks to see if entity is a player or an inanimate object.
if(is_user_connected(pTouched))
{
icearrow_effects(pToucher, pTouched, aimvec)
return PLUGIN_CONTINUE
}

icearrow_effects(pToucher, 0, aimvec)

return PLUGIN_CONTINUE
}
//-----------------------------------------------------------------------------------------

public icearrow_effects(pToucher, pTouched, aimvec[3]) //effects for when disk touch
{
new Float:fVelocity[3]
new velocity[3]
entity_get_vector(pToucher, EV_VEC_velocity, fVelocity)
FVecIVec(fVelocity, velocity)

new killer = entity_get_edict(pToucher, EV_ENT_owner)

if(is_user_alive(pTouched))
{

new victim = pTouched

if(cs_get_user_team(victim) != cs_get_user_team(killer))
{

p_data_b[victim][PB_STUNNED] = true;
SHARED_SetSpeed( victim );
set_task( FROSTBOLT_HOLD_TIME, "SHARED_ResetMaxSpeed", TASK_RESETSPEED + victim );
// Make the user glow!
SHARED_GlowShell(victim, 0, 255, 255, 2.5, 30);

if(find_ent_by_owner(-1,"ice_arrow",killer)!=0)
remove_entity(find_ent_by_owner(-1,"ice_arrow",killer))
}

}

}
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
exec1337
сообщение 8.5.2013, 17:40
Сообщение #17
Стаж: 13 лет

Сообщений: 6490
Благодарностей: 2558
Полезность: 491

Какой плагин главный? Который всё собирает? Тот,что в первом посте?
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя 4mokRp
сообщение 8.5.2013, 17:44
Сообщение #18
Стаж: 13 лет

Сообщений: 60
Благодарностей: 1
Полезность: < 0

Цитата(exec1337 @ 8.5.2013, 19:40) *
Какой плагин главный? Который всё собирает? Тот,что в первом посте?

Да
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя daywer
сообщение 8.5.2013, 18:28
Сообщение #19


Стаж: 13 лет
Город: Санкт-Петербург


Сообщений: 136
Благодарностей: 121
Полезность: 1051

menus.inl > MENU_ChangeRace > if(i==9)


Написание плагинов на заказ.(sql,sqlite,nvault)
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя 4mokRp
сообщение 8.5.2013, 18:51
Сообщение #20
Стаж: 13 лет

Сообщений: 60
Благодарностей: 1
Полезность: < 0

Цитата(daywer @ 8.5.2013, 20:28) *
menus.inl > MENU_ChangeRace > if(i==9)

А поконкретнее можно?
вот исходник
Скрытый текст


public MENU_War3Menu( idUser )
{
static pos, szMenu[256], keys;
keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<9);
pos = 0;

// Add the title
pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "%L^n^n", LANG_PLAYER, "MENU_WAR3MENU" );

// Add the actual options to the menu
pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "\w1. %L^n", LANG_PLAYER, "SKILLS_MENU" );
pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "\w2. %L^n", LANG_PLAYER, "RACE_MENU" );
pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "\w3. %L^n", LANG_PLAYER, "ITEM_MENU" );
pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "\y4. %L^n", LANG_PLAYER, "HELP" );
pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "\r5. %L^n", LANG_PLAYER, "ADMIN_MENU_TITLE" );
pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "\w6. %L^n", LANG_PLAYER, "MENU_TALISMAN_MENU_NAME" );//Для talisman +
pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "^n\d0. %L", LANG_PLAYER, "WORD_EXIT" );

// Display the menu
show_menu( idUser, keys, szMenu, -1 );

return;
}

public _MENU_War3Menu( idUser, key )
{

if ( !WC3_Check() )
{
return PLUGIN_HANDLED;
}

switch ( key )
{
case 0: menu_Skill_Options( idUser );
case 1: menu_Race_Options( idUser );
case 2: menu_Item_Options( idUser );
case 3: MOTD_War3help( idUser );
case 4: menu_Admin_Options( idUser );
case 5: fShowMenuTalismans( idUser ); //Для talisman +
}

return PLUGIN_HANDLED;
}

public menu_Skill_Options( idUser )
{

new pos = 0, menu_body[512]
new keys = (1<<0)|(1<<1)|(1<<2)|(1<<8)|(1<<9)
new szMenuItemSelectSkills[64];
new szMenuItemSkillInfo[64];
new szMenuItemReselectSkill[64];

format(szMenuItemSelectSkills,charsmax(szMenuItemSelectSkills),"\w%L",LANG_PLAYER,"SELECT_SKILLS")
format(szMenuItemSkillInfo,charsmax(szMenuItemSkillInfo),"\y%L",LANG_PLAYER,"SKILLS_INFORMATION")
format(szMenuItemReselectSkill,charsmax(szMenuItemReselectSkill),"\r%L",LANG_PLAYER,"RESELECT_SKILLS")

pos += format(menu_body[pos], charsmax(menu_body)-pos, "%L^n^n",LANG_PLAYER,"MENU_SKILLS_OPTIONS")

pos += format(menu_body[pos], charsmax(menu_body)-pos, "\w1. %s^n",szMenuItemSelectSkills)
pos += format(menu_body[pos], charsmax(menu_body)-pos, "\y2. %s^n",szMenuItemSkillInfo)
pos += format(menu_body[pos], charsmax(menu_body)-pos, "\r3. %s^n",szMenuItemReselectSkill)

pos += format(menu_body[pos], charsmax(menu_body)-pos, "^n^n\d9. %L",LANG_PLAYER,"BACK_STRING")
pos += format(menu_body[pos], charsmax(menu_body)-pos, "^n\d0. %L",LANG_PLAYER,"WORD_EXIT")
show_menu(idUser,keys,menu_body,-1)

return PLUGIN_CONTINUE
}

public _menu_Skill_Options(idUser,key){

if ( !WC3_Check() )
{
return PLUGIN_HANDLED;
}

switch (key){
case 0: MENU_SelectSkill( idUser );
case 1: MOTD_SkillsInfo( idUser );
case 2: CMD_Handle( idUser, "resetskills", true );
case 8: MENU_War3Menu(idUser)
default: return PLUGIN_HANDLED;
}

return PLUGIN_HANDLED;
}

public menu_Race_Options(idUser)
{
new pos = 0, menu_body[512]
new keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<8)|(1<<9)

new szMenuItemChangeRace[64];
new szMenuItemShowLevel[64];
new szMenuItemResetXP[64];
new szMenuItemShowPlayerSkills[64];

format(szMenuItemChangeRace,charsmax(szMenuItemChangeRace),"\w%L",LANG_PLAYER,"CHANGE_RACE")
format(szMenuItemShowLevel,charsmax(szMenuItemShowLevel),"\y%L",LANG_PLAYER,"SHOW_LEVEL")
format(szMenuItemResetXP,charsmax(szMenuItemResetXP),"\y%L",LANG_PLAYER,"RESET_XP")
format(szMenuItemShowPlayerSkills,charsmax(szMenuItemShowPlayerSkills),"\r%L",LANG_PLAYER,"SHOW_PLAYER_SKILLS")

pos += format(menu_body[pos], charsmax(menu_body)-pos, "%L^n^n",LANG_PLAYER,"MENU_RACE_OPTIONS")

pos += format(menu_body[pos], charsmax(menu_body)-pos, "\w1. %s^n",szMenuItemChangeRace)
pos += format(menu_body[pos], charsmax(menu_body)-pos, "\y2. %s^n",szMenuItemShowLevel)
pos += format(menu_body[pos], charsmax(menu_body)-pos, "\y3. %s^n",szMenuItemResetXP)
pos += format(menu_body[pos], charsmax(menu_body)-pos, "\r4. %s^n",szMenuItemShowPlayerSkills)

pos += format(menu_body[pos], charsmax(menu_body)-pos, "^n^n\d9. %L",LANG_PLAYER,"BACK_STRING")
pos += format(menu_body[pos], charsmax(menu_body)-pos, "^n\d0. %L",LANG_PLAYER,"WORD_EXIT")
show_menu(idUser,keys,menu_body,-1)

return PLUGIN_CONTINUE
}

public _menu_Race_Options(idUser,key)
{

if ( !WC3_Check() )
{
return PLUGIN_HANDLED;
}

switch (key)
{
case 0: WC3_ChangeRaceStart( idUser );
case 1: WC3_ShowRaceInfo( idUser );
case 2: MENU_ResetXP( idUser );
case 3: MOTD_PlayerSkills( idUser, true );
case 8: MENU_War3Menu(idUser)
default: return PLUGIN_HANDLED;
}

return PLUGIN_HANDLED;
}

public menu_Item_Options(idUser)
{

new pos = 0, menu_body[512]
new keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<8)|(1<<9)

new szMenuItemShopOption1[64];
new szMenuItemShopOption2[64];
new szMenuItemShopOption3[64];
new szMenuItemShopInfo1[64];
new szMenuItemShopInfo2[64];
new szMenuItemShopInfo3[64];

formatex(szMenuItemShopOption1,charsmax(szMenuItemShopOption1),"\r%L",LANG_PLAYER,"SHOPMENU1_OPTION")
formatex(szMenuItemShopOption2,charsmax(szMenuItemShopOption2),"\r%L",LANG_PLAYER,"SHOPMENU2_OPTION")
formatex(szMenuItemShopOption3,charsmax(szMenuItemShopOption3),"\r%L",LANG_PLAYER,"SHOPMENU3_OPTION")
formatex(szMenuItemShopInfo1,charsmax(szMenuItemShopInfo1),"\y%L",LANG_PLAYER,"SHOW_SHOPMENU1_INFO")
formatex(szMenuItemShopInfo2,charsmax(szMenuItemShopInfo2),"\y%L",LANG_PLAYER,"SHOW_SHOPMENU2_INFO")
formatex(szMenuItemShopInfo3,charsmax(szMenuItemShopInfo3),"\y%L",LANG_PLAYER,"SHOW_SHOPMENU3_INFO")

pos += formatex(menu_body[pos], charsmax(menu_body)-pos, "%L^n^n",LANG_PLAYER,"MENU_ITEM_OPTIONS")

pos += formatex(menu_body[pos], charsmax(menu_body)-pos, "\r1. %s^n",szMenuItemShopOption1)
pos += formatex(menu_body[pos], charsmax(menu_body)-pos, "\r2. %s^n",szMenuItemShopOption2)
pos += formatex(menu_body[pos], charsmax(menu_body)-pos, "\r3. %s^n",szMenuItemShopOption3)
pos += formatex(menu_body[pos], charsmax(menu_body)-pos, "\y4. %s^n",szMenuItemShopInfo1)
pos += formatex(menu_body[pos], charsmax(menu_body)-pos, "\y5. %s^n",szMenuItemShopInfo2)
pos += formatex(menu_body[pos], charsmax(menu_body)-pos, "\y6. %s^n",szMenuItemShopInfo3)

pos += formatex(menu_body[pos], charsmax(menu_body)-pos, "^n^n\d9. %L",LANG_PLAYER,"BACK_STRING")
pos += formatex(menu_body[pos], charsmax(menu_body)-pos, "^n\d0. %L",LANG_PLAYER,"WORD_EXIT")
show_menu(idUser,keys,menu_body,-1)

return PLUGIN_CONTINUE
}

public _menu_Item_Options(idUser,key)
{

if ( !WC3_Check() )
{
return PLUGIN_HANDLED;
}

switch (key)
{
case 0: MENU_Shopmenu( idUser, 0 );
case 1: MENU_Shopmenu( idUser, 9 );
case 2: MENU_Shopmenu( idUser, 18 );
case 3: MOTD_ItemsInfo( idUser, 0 );
case 4: MOTD_ItemsInfo( idUser, 9 );
case 5: MOTD_ItemsInfo( idUser, 18 );
case 8: MENU_War3Menu(idUser);
default: return PLUGIN_HANDLED;
}

return PLUGIN_HANDLED;
}

public menu_Admin_Options(idUser)
{

if ( idUser && !( get_user_flags( idUser ) & XP_GetAdminFlag() ) )
{
format(szMessage, sizeof(szMessage) - 1, "%L%L%L %L",
LANG_PLAYER,"WC3_BRACKET_LEFT",LANG_PLAYER,"WC3_MODCLIENT",LANG_PLAYER,"WC3_BRACKET_RIGHT",
LANG_PLAYER,"YOU_HAVE_NO_ACCESS");

client_print( idUser, print_console, szMessage );

return PLUGIN_HANDLED
}

new pos = 0, menu_body[512]
new keys = (1<<0)|(1<<1)|(1<<2)|(1<<8)|(1<<9)

new szMenuItemGiveIndXP[64];
new szMenuItemGiveMultXP[64];
new szMenuItemSaveAll[64];

format(szMenuItemGiveIndXP,charsmax(szMenuItemGiveIndXP),"\r%L",LANG_PLAYER,"GIVE_IND_XP")
format(szMenuItemGiveMultXP,charsmax(szMenuItemGiveMultXP),"\r%L",LANG_PLAYER,"GIVE_MULT_XP")
format(szMenuItemSaveAll,charsmax(szMenuItemSaveAll),"\y%L",LANG_PLAYER,"SAVE_ALL_XP")

pos += format(menu_body[pos], charsmax(menu_body)-pos, "%L^n^n",LANG_PLAYER,"MENU_ADMIN_MENU")

pos += formatex(menu_body[pos], charsmax(menu_body)-pos, "\r1. %s^n",szMenuItemGiveIndXP)
pos += formatex(menu_body[pos], charsmax(menu_body)-pos, "\r2. %s^n",szMenuItemGiveMultXP)
pos += formatex(menu_body[pos], charsmax(menu_body)-pos, "\y3. %s^n",szMenuItemSaveAll)

pos += format(menu_body[pos], charsmax(menu_body)-pos, "^n^n\d9. %L",LANG_PLAYER,"BACK_STRING")
pos += format(menu_body[pos], charsmax(menu_body)-pos, "^n\d0. %L",LANG_PLAYER,"WORD_EXIT")
show_menu(idUser,keys,menu_body,-1)

return PLUGIN_CONTINUE
}

public _menu_Admin_Options(idUser,key)
{

if ( !WC3_Check() )
{
return PLUGIN_HANDLED;
}

switch (key)
{
case 0:
{
g_menuOption[idUser] = 1
g_menuSettings[idUser] = 500
menu_PlayerXP_Options(idUser,g_menuPosition[idUser] = 0)
}
case 1:
{
g_menuOption[idUser] = 1
g_menuSettings[idUser] = 500
menu_TeamXP_Options(idUser)
}
case 2: DB_SaveAll( false );
case 8: MENU_War3Menu(idUser)
}

return PLUGIN_HANDLED;
}

public menu_PlayerXP_Options(idUser,pos)
{
if (pos < 0)
{
menu_Admin_Options(idUser)
return PLUGIN_CONTINUE
}

get_players(g_menuPlayers[idUser],g_menuPlayersNum[idUser])
new menuBody[512]
new b = 0
new i
new name[32], team[4], title[128], back[16], exitstring[16]
new start = pos * 7
if (start >= g_menuPlayersNum[idUser])
start = pos = g_menuPosition[idUser] = 0

format(title,127,"%L",LANG_PLAYER,"MENU_GIVE_PLAYERS_XP")
new len = format(menuBody,charsmax(menuBody), "%s\R%d/%d^n\w^n",title,pos+1,(g_menuPlayersNum[idUser] / 7 + ((g_menuPlayersNum[idUser] % 7) ? 1 : 0 )))
new end = start + 7
new keys = (1<<9)|(1<<7)

if (end > g_menuPlayersNum[idUser])
end = g_menuPlayersNum[idUser]

for(new a = start; a < end; ++a)
{
i = g_menuPlayers[idUser][a]
get_user_name(i,name,31)
get_user_team(i,team,3)
keys |= (1<<b)
len += format(menuBody[len],charsmax(menuBody)-len,"\w%d. %s^n\w",++b,name)
}

format(title,charsmax(title),"%L",LANG_PLAYER,"GIVE")
len += format(menuBody[len],charsmax(menuBody)-len,"^n8. %s %d XP^n",title,g_menuSettings[idUser])

format(back,15,"%L",LANG_PLAYER,"BACK_STRING")

if (end != g_menuPlayersNum[idUser])
{
format(menuBody[len],charsmax(menuBody)-len,"^n9. %L...^n0. %s", LANG_PLAYER,"MORE_STRING", pos ? back : back)
keys |= (1<<8)
}
else
{
format(exitstring,charsmax(exitstring),"%L",LANG_PLAYER,"WORD_EXIT")
format(menuBody[len],charsmax(menuBody)-len,"^n0. %s", pos ? back : exitstring)
}

show_menu(idUser,keys,menuBody,-1)

return PLUGIN_CONTINUE

}

public _menu_PlayerXP_Options(idUser,key)
{

if ( !WC3_Check() )
{
return PLUGIN_HANDLED;
}

switch(key)
{
case 7:
{
++g_menuOption[idUser]
if (g_menuOption[idUser]>6)
{
g_menuOption[idUser]=1
}
switch(g_menuOption[idUser])
{
case 1: g_menuSettings[idUser] = 500
case 2: g_menuSettings[idUser] = 1000
case 3: g_menuSettings[idUser] = 5000
case 4: g_menuSettings[idUser] = 10000
case 5: g_menuSettings[idUser] = 50000
case 6: g_menuSettings[idUser] = 100000
case 7: g_menuSettings[idUser] = 1000000
}
menu_PlayerXP_Options(idUser,g_menuPosition[idUser])
}
case 8: menu_PlayerXP_Options(idUser,++g_menuPosition[idUser])
case 9: return PLUGIN_HANDLED;
default:
{
new idPlayer = g_menuPlayers[idUser][g_menuPosition[idUser] * 7 + key]

// if((get_user_flags(idPlayer) & ADMIN_FLAG))
// {
format(szMessage, sizeof(szMessage) - 1, "^x01%L^x03%L^x01%L ^x04%L ^x03%d ^x04XP",
LANG_PLAYER,"WC3_BRACKET_LEFT",LANG_PLAYER,"WC3_MODCLIENT",LANG_PLAYER,"WC3_BRACKET_RIGHT",
LANG_PLAYER,"THE_ADMIN_JUST_GAVE_YOU_XP",
g_menuSettings[idUser]);

cssbColoredPrint(idPlayer, szMessage);

p_data[idPlayer][P_XP] += g_menuSettings[idUser]

XP_Check( idPlayer );

menu_PlayerXP_Options(idUser,g_menuPosition[idUser])

new szUserName[32];
get_user_name(idPlayer, szUserName, 31 );
ADMIN_Log(idUser, "Give XP","%d %s", g_menuSettings[idUser],szUserName);
//}
}
}

return PLUGIN_HANDLED;
}

public menu_TeamXP_Options(idUser)
{

new pos = 0, menu_body[512], give[16]
new keys = (1<<0)|(1<<1)|(1<<2)|(1<<7)|(1<<8)|(1<<9)

new szMenuItemTerrorist[64];
new szMenuItemCT[64];
new szMenuItemEveryone[64];

format(szMenuItemTerrorist,charsmax(szMenuItemTerrorist),"\y%L",LANG_PLAYER,"TERRORISTS")
format(szMenuItemCT,charsmax(szMenuItemCT),"\y%L",LANG_PLAYER,"CT")
format(szMenuItemEveryone,charsmax(szMenuItemEveryone),"\r%L",LANG_PLAYER,"EVERYONE")

pos += format(menu_body[pos], charsmax(menu_body)-pos, "%L^n^n",LANG_PLAYER,"MENU_TEAM_XP")

pos += formatex(menu_body[pos], charsmax(menu_body)-pos, "\y1. %s^n",szMenuItemTerrorist)
pos += formatex(menu_body[pos], charsmax(menu_body)-pos, "\y2. %s^n",szMenuItemCT)
pos += formatex(menu_body[pos], charsmax(menu_body)-pos, "\r3. %s^n",szMenuItemEveryone)

format(give,charsmax(give),"\w%L",LANG_PLAYER,"GIVE")
pos += format(menu_body[pos], charsmax(menu_body)-pos,"^n\w8. %s %d XP^n",give,g_menuSettings[idUser])
pos += format(menu_body[pos], charsmax(menu_body)-pos, "^n^n\d9. %L",LANG_PLAYER,"BACK_STRING")
pos += format(menu_body[pos], charsmax(menu_body)-pos, "^n\d0. %L",LANG_PLAYER,"WORD_EXIT")
show_menu(idUser,keys,menu_body,-1)

return PLUGIN_CONTINUE
}

public _menu_TeamXP_Options(idUser,key){

if ( !WC3_Check() )
{
return PLUGIN_HANDLED;
}

switch(key)
{
case 0:
{
ADMIN_GiveXP( idUser, "@T", g_menuSettings[idUser] );
ADMIN_Log(idUser, "Give XP @T","%d", g_menuSettings[idUser]);
menu_TeamXP_Options(idUser)
}
case 1:
{
ADMIN_GiveXP( idUser, "@CT", g_menuSettings[idUser] );
ADMIN_Log(idUser, "Give XP @CT","%d", g_menuSettings[idUser]);
menu_TeamXP_Options(idUser)
}
case 2:
{
ADMIN_GiveXP( idUser, "@ALL", g_menuSettings[idUser] );
ADMIN_Log(idUser, "Give XP @ALL","%d", g_menuSettings[idUser]);
menu_TeamXP_Options(idUser)
}
case 7:
{
++g_menuOption[idUser]
if (g_menuOption[idUser]>6)
{
g_menuOption[idUser]=1
}
switch(g_menuOption[idUser])
{
case 1: g_menuSettings[idUser] = 500
case 2: g_menuSettings[idUser] = 1000
case 3: g_menuSettings[idUser] = 5000
case 4: g_menuSettings[idUser] = 10000
case 5: g_menuSettings[idUser] = 50000
case 6: g_menuSettings[idUser] = 100000
case 7: g_menuSettings[idUser] = 1000000
}
menu_TeamXP_Options(idUser)
}
case 8: menu_Admin_Options(idUser)
}

return PLUGIN_HANDLED;
}

public MENU_ResetXP(idUser)
{
if(!(get_user_flags(idUser) & ADMIN_FLAG))
{
format(szMessage, sizeof(szMessage) - 1, "%L%L%L %L",
LANG_PLAYER,"WC3_BRACKET_LEFT",LANG_PLAYER,"WC3_MODCLIENT",LANG_PLAYER,"WC3_BRACKET_RIGHT",
LANG_PLAYER,"YOU_HAVE_NO_ACCESS");

client_print( idUser, print_console,szMessage);
cssbColoredPrint(idUser, szMessage);

return;
}

static szMenu[128];
new keys = (1<<0)|(1<<1)|(1<<9);

formatex(szMenu, sizeof(szMenu) - 1, "%L^n^n\w1. %L^n\w2. %L",
LANG_PLAYER,"MENU_RESET_XP",
LANG_PLAYER,"WC3_YES",
LANG_PLAYER,"WC3_NO");

show_menu( idUser, keys, szMenu, -1 );

return;
}

public _MENU_ResetXP( idUser, key )
{

if ( !WC3_Check() )
{
return PLUGIN_HANDLED;
}

// User selected yes
if ( key == 0 )
{
XP_Reset( idUser );
}

return PLUGIN_HANDLED;
}

// Function will display the changerace menu
public MENU_ChangeRace( idUser, iRaceXP[MAX_RACES] )
{

new szRaceName[MAX_RACES+1][64], i, pos, iKeys = 0, szMenu[512], szXP[16];

// Get our race names
for ( i = 0; i < get_pcvar_num( CVAR_wc3_races ); i++ )
{
lang_GetRaceName( i + 1, idUser, szRaceName[i], 63 );
}

pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "%L", LANG_PLAYER, "MENU_SELECT_RACE" );

// Then add the experience column
if ( get_pcvar_num( CVAR_wc3_save_xp ) )
{
pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "\R%L^n^n", LANG_PLAYER, "MENU_WORD_EXPERIENCE" );
}
else
{
//pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "^n^n" );
pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "^n" );
}

// Build the changerace menu (for every race)
for ( i = 0; i < get_pcvar_num( CVAR_wc3_races ); i++ )
{
num_to_str( iRaceXP[i], szXP, 15 );

// Add the "Select a Hero" message if necessary
if ( i == 4 )
{
pos += format( szMenu[pos], charsmax(szMenu)-pos, "%L", LANG_PLAYER, "SELECT_HERO" );
}

// User's current race
if ( i == p_data[idUser][P_RACE] - 1 )
{
if(i == 8)
pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "\r%d. %s\r\R%s^n", i + 1, szRaceName[i], ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) );
else
pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "\d%d. %s\d\R%s^n", i + 1, szRaceName[i], ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) );

iKeys |= (1<<i);
}

// Race the user wants to change to
else if ( i == p_data[idUser][P_CHANGERACE] - 1 )
{
pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "\r%d. %s\r\R%s^n", i + 1, szRaceName[i], ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) );

iKeys |= (1<<i);
}

// All other cases
else
{

new bool:bAllowRace = true;

// Check to see if the user can choose this race (are there too many of this race?)
if ( bAllowRace )
{
if(i == 9)
pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "\r%d. %s\r\R%s^n", i + 1, szRaceName[i], ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) );
else
pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "\w%d. %s\y\R%s^n", i + 1, szRaceName[i], ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) );

iKeys |= (1<<i);
}

// If not, display the race, but don't give them a key to press
else
{
pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "\d%d. %s\y\R%s^n", i + 1, szRaceName[i], ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) );
}
}

}

iKeys |= (1<<i);

// Show the menu to the user!
show_menu( idUser, iKeys, szMenu, -1 );

return;
}

public _MENU_ChangeRace( idUser, key )
{

if ( !WC3_Check() )
{
return PLUGIN_HANDLED;
}


// Save the current race data before we change
DB_SaveXP( idUser, false );

new iRace;

iRace = key + 1;

if(iRace == 10 )
{
if(!(get_user_flags(idUser) & ADMIN_FLAG) && get_pcvar_num(CVAR_frostmage_onlyvip))
{
format(szMessage, sizeof(szMessage) - 1, "%L%L%L %L",
LANG_PLAYER,"WC3_BRACKET_LEFT",LANG_PLAYER,"WC3_MODCLIENT",LANG_PLAYER,"WC3_BRACKET_RIGHT",
LANG_PLAYER,"YOU_HAVE_NO_ACCESS");

client_print( idUser, print_chat,szMessage);
cssbColoredPrint(idUser, szMessage);

// Get the race's name
new szRaceName[64];
lang_GetRaceName( iRace, idUser, szRaceName, 63 );

show_motd(idUser, "addons/amxmodx/configs/war3ft/RaceVipFrostMage.txt", szRaceName);

return PLUGIN_HANDLED;
}
}


// User currently has a race
if ( p_data[idUser][P_RACE] != 0 )
{

// Change the user's race at the start of next round
if ( iRace != p_data[idUser][P_RACE] )
{

// Special message for csdm
if ( CVAR_csdm_active > 0 && get_pcvar_num( CVAR_csdm_active ) == 1 )
{
format(szMessage, sizeof(szMessage) - 1, "%L",LANG_PLAYER,"CLIENT_PRINT_MENU_CHANGE_RACE");
client_print( idUser, print_center,szMessage);

}
else
{
format(szMessage, sizeof(szMessage) - 1, "%L",LANG_PLAYER,"CENTER_CHANGED_NEXT");
client_print( idUser, print_center,szMessage);
}

p_data[idUser][P_CHANGERACE] = iRace;
}

// Do nothing
else
{
p_data[idUser][P_CHANGERACE] = 0;
}
}

// User doesn't have a race so give it to him!!!
else
{
WC3_SetRace( idUser, iRace );
}

return PLUGIN_HANDLED;
}

public MENU_ReplaceItem( idUser )
{

new szMenu[512] = "", pos = 0;
new iKeys = (1<<9)|(1<<0)|(1<<1)|(1<<2);

// Add the menu header
pos += format( szMenu[pos], charsmax(szMenu)-pos, "%L^n^n", LANG_PLAYER, "MENU_REPLACE_ITEM" );

new szItemName[64], szItemName2[64],szItemName3[64];
LANG_GetItemName( g_iShopMenuItems[idUser][ITEM_SLOT_ONE], idUser, szItemName, charsmax(szItemName) );
LANG_GetItemName( g_iShopMenuItems[idUser][ITEM_SLOT_TWO], idUser, szItemName2, charsmax(szItemName2) );
LANG_GetItemName( g_iShopMenuItems[idUser][ITEM_SLOT_THREE], idUser, szItemName3, charsmax(szItemName3) );

// Add the items
pos += format( szMenu[pos], charsmax(szMenu)-pos, "\y1. %s^n", szItemName );
pos += format( szMenu[pos], charsmax(szMenu)-pos, "\y2. %s^n", szItemName2 );
pos += format( szMenu[pos], charsmax(szMenu)-pos, "\y3. %s^n", szItemName3 );

// Add the exit option
pos += format( szMenu[pos], charsmax(szMenu)-pos, "^n\d0. %L", LANG_PLAYER, "WORD_EXIT" );

// Show the menu
show_menu( idUser, iKeys, szMenu, -1 );

return;
}

public _menu_ReplaceItem( idUser, iKey )
{
if ( !WC3_Check() || iKey == 9 )
{
return PLUGIN_HANDLED;
}

// Remove item from item slot one
if ( iKey == 0 )
{
ITEM_Remove( idUser, ITEM_SLOT_ONE )
}

// Remove item from itemslot two
if ( iKey == 1 )
{
ITEM_Remove( idUser, ITEM_SLOT_TWO )
}
// Remove item from itemslot two
if ( iKey == 2 )
{
ITEM_Remove( idUser, ITEM_SLOT_THREE )
}

// Then the user typed "rings"
if ( g_iFutureItem[idUser] == -3 )
{
ITEM_BuyRings( idUser );
}
else
{
ITEM_Buy( idUser, g_iFutureItem[idUser] );
}

return PLUGIN_HANDLED;
}

public MENU_Shopmenu( idUser, iStart )
{

if ( !ITEM_MenuCanBuyCheck( idUser ) )
{
return;
}

// Shopmenu2 can't display if we don't have the correct number of races!
if ( iStart == MAX_PAGE_ITEMS && get_pcvar_num( CVAR_wc3_races ) <= 4 )
{
return;
}

new szMenu[512], szItemName[64], pos = 0, i, iItemID;
new iKeys = (1<<9);

// Add the header
if ( iStart == 0 )
{
pos += format( szMenu[pos], charsmax(szMenu)-pos, "%L", LANG_PLAYER, "MENU_BUY_ITEM" );
}

// "Shopmenu 2"
if ( iStart == MAX_PAGE_ITEMS )
{
pos += format( szMenu[pos], charsmax(szMenu)-pos, "%L", LANG_PLAYER, "MENU_BUY_ITEM2" );
}
// "Shopmenu 3"
if ( iStart == 18 )
{
pos += format( szMenu[pos], charsmax(szMenu)-pos, "%L", LANG_PLAYER, "MENU_BUY_ITEM3" );
}


// Lets add the items to the menu!
for ( i = 0; i < MAX_PAGE_ITEMS; i++ )
{
iItemID = iStart + i;

LANG_GetItemName( iItemID, idUser, szItemName,charsmax(szItemName));

new iItemMoney = ITEM_Cost( idUser, iItemID );
new iUserMoney = SHARED_GetUserMoney( idUser );

if(iUserMoney < iItemMoney)
pos += format( szMenu[pos], charsmax(szMenu)-pos, "\d%d. %s\R%d^n", i + 1, szItemName, ITEM_Cost( idUser, iItemID ) );
else
pos += format( szMenu[pos], charsmax(szMenu)-pos, "\y%d. %s\r\R%d^n", i + 1, szItemName, ITEM_Cost( idUser, iItemID ) );

iKeys |= (1<<i);
}

pos += format( szMenu[pos], charsmax(szMenu)-pos, "^n\d0. %L", LANG_PLAYER, "WORD_EXIT" );

show_menu( idUser, iKeys, szMenu, -1 );
}

//Для shopmenu1
public _MENU_Shopmenu1( idUser, iKey )
{
if ( !WC3_Check() || iKey == 9 )
{
return PLUGIN_HANDLED;
}

new iItemMoney = ITEM_Cost( idUser, iKey );
new iUserMoney = SHARED_GetUserMoney( idUser );

if(iUserMoney < iItemMoney)
MENU_Shopmenu( idUser, 0 );


ITEM_Buy( idUser, iKey );

return PLUGIN_HANDLED;
}
//Для shopmenu2
public _MENU_Shopmenu2( idUser, iKey )
{
if ( !WC3_Check() || iKey == 9 )
{
return PLUGIN_HANDLED;
}

iKey += MAX_PAGE_ITEMS;

new iItemMoney = ITEM_Cost( idUser, iKey );
new iUserMoney = SHARED_GetUserMoney( idUser );

if(iUserMoney < iItemMoney)
MENU_Shopmenu( idUser, 9 );


ITEM_Buy( idUser, iKey );

return PLUGIN_HANDLED;
}

//Для shopmenu3
public _MENU_Shopmenu3( idUser, iKey )
{
if ( !WC3_Check() || iKey == 9 )
return PLUGIN_HANDLED;

iKey += 18;

new iItemMoney = ITEM_Cost( idUser, iKey );
new iUserMoney = SHARED_GetUserMoney( idUser );

if(iUserMoney < iItemMoney)
MENU_Shopmenu( idUser, 18 );


ITEM_Buy( idUser, iKey );

return PLUGIN_HANDLED;
}

public MENU_SelectSkill( idUser )
{

// User has no race, how can we select skills?!?
if ( p_data[idUser][P_RACE] == 0 )
{
//set_hudmessage(200, 100, 0, -1.0, 0.3, 0, 1.0, 5.0, 0.1, 0.2, 2)
WC3_StatusText( idUser, TXT_TOP_CENTER, "%L", LANG_PLAYER, "SELECT_RACE_BEFORE_SKILLS" );

return;
}

// They don't choose skills when it's random
else if ( p_data[idUser][P_RACE] == RACE_CHAMELEON && get_pcvar_num( CVAR_wc3_cham_random ) )
{
//WC3_StatusText( idUser, TXT_TOP_CENTER, "%s", "Chameleons can't select skills!" );
CHAM_ConfigureSkills( idUser );

return;
}

// Lets make sure the user has some available skill points
new iSkillsUsed = SM_TotalSkillPointsUsed( idUser );
if ( iSkillsUsed >= p_data[idUser][P_LEVEL] )
{

//set_hudmessage(200, 100, 0, -1.0, 0.3, 0, 1.0, 5.0, 0.1, 0.2, 2)
WC3_StatusText( idUser, TXT_TOP_CENTER, "%L", LANG_PLAYER, "ALREADY_SELECTED_SKILL_POINTS" );

return;
}

// Bots don't need a menu now do they??
if ( is_user_bot( idUser ) )
{
// No race has been selected yet!!
if ( !SM_SkillAvailable( idUser ) )
{
return;
}

// Keep giving the bot a random ID until we are full!
while ( iSkillsUsed < p_data[idUser][P_LEVEL] )
{
SM_GiveRandomSkillPoint( idUser );

iSkillsUsed = SM_TotalSkillPointsUsed( idUser );
}

return;
}

// OK set up a menu!!!

new szMsg[512], pos = 0, szSkillName[64];
new iSkillCounter = 0, iSkillID = 0, iKeys = (1<<9), iSkillLevel;


// Add the menu header
pos += formatex( szMsg[pos], charsmax(szMsg)-pos, "%L", LANG_PLAYER, "MENU_SELECT_SKILL" );

iSkillID = SM_GetSkillByPos( idUser, iSkillCounter );

while ( iSkillID != -1 )
{
iSkillLevel = SM_GetSkillLevel( idUser, iSkillID, 4 );

LANG_GetSkillName( iSkillID , idUser, szSkillName, 63, 1 );

// Add the trainable skills to the menu
if ( SM_GetSkillType( iSkillID ) == SKILL_TYPE_TRAINABLE )
{

// Only add it to the menu if they don't have level 3 already!
if ( iSkillLevel < MAX_SKILL_LEVEL )
{

// User isn't high enough of a level to select this skill yet
if ( p_data[idUser][P_LEVEL] <= 2 * iSkillLevel )
{
pos += formatex( szMsg[pos], charsmax(szMsg)-pos, "\d" );
}

// Then the user can choose it!
else
{
iKeys |= (1<<iSkillCounter);
}

pos += formatex( szMsg[pos], charsmax(szMsg)-pos, "^n%d. %s %L %d\w", iSkillCounter+1, szSkillName, LANG_PLAYER, "WORD_LEVEL", iSkillLevel + 1 );
}
}

// Add the ultimate to the menu
else if ( SM_GetSkillType( iSkillID ) == SKILL_TYPE_ULTIMATE )
{

if ( iSkillLevel < MAX_ULTIMATE_LEVEL )
{
// User can't choose ultimate yet :/
if ( p_data[idUser][P_LEVEL] <= 5 )
{
pos += formatex( szMsg[pos], charsmax(szMsg)-pos, "\d" );
}

// Then the user is level 6 or above and can select their ultimate!
else
{
iKeys |= (1<<iSkillCounter);
}

pos += formatex( szMsg[pos], charsmax(szMsg)-pos, "^n%d. %L: %s\w", iSkillCounter+1, LANG_PLAYER, "WORD_ULTIMATE", szSkillName );
}
}

iSkillCounter++;
iSkillID = SM_GetSkillByPos( idUser, iSkillCounter );
}

// Add the cancel button to the menu
pos += formatex( szMsg[pos], charsmax(szMsg)-pos, "^n^n\d0. %L", LANG_PLAYER, "WORD_CANCEL" );

// Show the menu!
show_menu( idUser, iKeys, szMsg, -1 );

return;
}

public _MENU_SelectSkill( idUser, iKey )
{

if ( !WC3_Check() || iKey == 9 )
{
return PLUGIN_HANDLED;
}

// Determine which key was just selected
new iSkillID = SM_GetSkillByPos( idUser, iKey );

// Set up the skill!
SM_SetSkill( idUser, iSkillID );

new iSkillsUsed = SM_TotalSkillPointsUsed( idUser );

// Then they have another skill to select!!
if ( iSkillsUsed < p_data[idUser][P_LEVEL] )
{
MENU_SelectSkill( idUser );
}

// No more, lets show them their latest level/XP
else
{
WC3_ShowBar( idUser );
}

return PLUGIN_HANDLED;
}

Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
2 страниц V   1 2
 
Тема закрытаНачать новую тему
 
0 пользователей и 1 гостей читают эту тему: