RU
RU
UA
EN
PL
ГЛАВНАЯ
УСЛУГИ
ПЛАГИНЫ
КАРТЫ
REBUY
SCANMON
CASSA
SALE
ФОРУМ
МОНИТОР
HELP
КОНТАКТ
Главная
/
Plugins
/
Герой CSDM
Герой CSDM
Теги:
Скачать плагины cs
Этот вариант СТАБИЛЕН и есть ТАЙМЕР до смерти героя!
Герой выдается на определенное время, дабы исключить AFK героя и кемперства !
Скринов нету. Модели героя тоже нету, сами найдете и поставите.
Автор: Pro100web
Компилятор: 1.8.2
+ZIP
2325
Команды:
Кваров и команд нет
.sma / .sp
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define INTERVAL_TASK 0.3 #define INTERVAL_TASK_VOICE 25.0 #define TASK_HUD 1234 #define TASK_HERO 12345 #define m_flPainShock 108 #define m_pActiveItem 373 #define OFFSET_LINUX 5 #define OFFSET_CSMONEY 115 #define HIDE_MONEY ( 1 << 5 ) #define HIDE_TIMER (1<<4) #define is_valid_player(%1) ( 1 <= %1 <= g_iMaxPlayers ) #define is_valid_team(%1) ( 0 < %1 < 3 ) #define fm_set_lights(%1) engfunc ( EngFunc_LightStyle, 0, %1 ) new g_iHero new g_iHeroTeam new g_iMoneyHero new g_iMaxPlayers new g_iMsgHookCurWeapon new g_iMsgHookMoney new g_iMsg_HideWeapon new g_iMsg_Snake new g_msgCurWeapon new g_msgMoney new g_cvHeroReward new iHealth,Float:TimerHealth new const g_iColors[][] = {{255, 0, 0}, {0, 0, 255}} // 0 = TT, 1 = CT new const g_hSound[][] = { "dmsentries/hero_1.wav", "dmsentries/hero_2.wav", "dmsentries/hero_3.wav", "dmsentries/hero_4.wav" } new Ham:Ham_Player_ResetMaxSpeed = Ham_Item_PreFrame public plugin_init () { register_plugin ( "Sentry Hero", "1.4", "QooQa & miRror" ) register_event ( "HLTV", "ev_RoundStart", "a", "1=0", "2=0" ) register_event ( "DeathMsg", "ev_PlayerDeath", "a" ) register_forward ( FM_ClientDisconnect, "fw_ClientDisconnect_Post", 1 ) RegisterHam ( Ham_TakeDamage, "player", "fw_PlayerTakeDamage_Post", 1 ) RegisterHam ( Ham_Player_ResetMaxSpeed, "player", "fw_ResetMaxSpeed_Post", 1 ) g_cvHeroReward = register_cvar ( "sentry_hero_reward", "10000" ) g_iMaxPlayers = get_maxplayers () g_msgCurWeapon = get_user_msgid ( "CurWeapon" ) g_msgMoney = get_user_msgid( "Money" ) g_iMsg_HideWeapon = get_user_msgid( "HideWeapon" ) g_iMsg_Snake = get_user_msgid( "ScreenShake" ) } public plugin_precache () { //precache_model ( "models/player/tirant/tirant.mdl" ) precache_sound ( "dmsentries/hero_start.wav" ) precache_sound ( "dmsentries/hero_dead.wav" ) for(new i=0;i < sizeof(g_hSound);i++) precache_sound ( g_hSound[i] ) } /* public client_connect(id) { if ( g_iHero ) set_lights("z") } */ public plugin_natives () { register_native ( "sh_set_hero", "native_set_hero" ) register_native ( "sh_get_hero", "native_get_hero" ) register_native ( "sh_check_hero", "native_check_hero" ) } public native_check_hero ( plugin_id, num_params ) { new id = get_param ( 1 ) if ( g_iHero == id ) return true return false } public native_get_hero ( plugin_id, num_params ) { return g_iHero } public native_set_hero ( plugin_id, num_params ) { new id = get_param ( 1 ) if ( !is_user_connected ( id ) ) return false if ( !is_user_alive ( id ) ) return false //if ( get_playersnum () < 16 ) // return false if ( g_iHero ) return false return SetHero ( id ) } public fw_ClientDisconnect_Post ( id ) { if ( g_iHero == id ) { ResetHero () set_dhudmessage ( 255, 255, 0, -1.0, 0.3, 0, 6.0, 3.0, 0.1, 1.5 ) show_dhudmessage ( 0, "Герой покинул игру!" ) client_cmd ( 0, "spk dmsentries/hero_dead.wav" ) } } public ev_RoundStart () ResetHero () public ev_PlayerDeath () { new iVictim = read_data ( 2 ) if ( g_iHero != iVictim ) return cs_set_user_money ( iVictim, g_iMoneyHero, 0 ) ResetHero () set_dhudmessage ( 255, 255, 0, -1.0, 0.3, 0, 6.0, 3.0, 0.1, 1.5 ) show_dhudmessage ( 0, "Герой убит!" ) client_cmd ( 0, "spk dmsentries/hero_dead.wav" ) new iKiller = read_data ( 1 ) if ( iVictim == iKiller || !is_valid_player ( iKiller ) ) return new iReward = get_pcvar_num ( g_cvHeroReward ) cs_set_user_money ( iKiller, min ( cs_get_user_money ( iKiller ) + iReward, 30000 ) ) new sName[32] get_user_name ( iKiller, sName, charsmax ( sName ) ) ChatColor ( 0, "^3[^4Информация^3]^1 Убийца героя - %s, он получает ^4%i$", sName, iReward ) } public msg_CurWeapon ( msgid, dest, id ) { if ( g_iHero != id ) return if ( !is_user_alive ( id ) || get_msg_arg_int ( 1 ) != 1 ) return if ( get_msg_arg_int ( 2 ) != CSW_AK47 ) return set_msg_arg_int ( 3, get_msg_argtype ( 3 ), 30 ) new iActiveItem = get_pdata_cbase ( id, m_pActiveItem, OFFSET_LINUX ) if ( iActiveItem <= 0 ) return cs_set_weapon_ammo ( iActiveItem, 30 ) } public fw_PlayerTakeDamage_Post ( victim, inflictor, attacker, Float:damage, damagebits ) { if ( g_iHero != victim ) return set_pdata_float ( victim, m_flPainShock, 1.0, OFFSET_LINUX ) } public fw_ResetMaxSpeed_Post ( id ) { if ( g_iHero != id || !is_user_alive ( id ) ) return fm_set_user_maxspeed ( id, 400.0 ) } SetHero ( id ) { if ( !is_user_connected ( id ) || !is_user_alive ( id ) ) return 0 new iTeam = _:cs_get_user_team ( id ) if ( !is_valid_team ( iTeam ) ) return 0 g_iHero = id TimerHealth = get_gametime()+120 g_iHeroTeam = iTeam-1 if ( !g_iMsgHookCurWeapon ) g_iMsgHookCurWeapon = register_message ( g_msgCurWeapon, "msg_CurWeapon" ) if ( !g_iMsgHookMoney ) g_iMsgHookMoney = register_message( g_msgMoney ,"message_money") fm_set_user_rendering ( id, kRenderFxGlowShell, g_iColors[g_iHeroTeam][0], g_iColors[g_iHeroTeam][1], g_iColors[g_iHeroTeam][2], kRenderNormal, 25 ) //cs_set_user_model ( id, "tirant" ) fm_strip_user_weapons ( id ) fm_give_item ( id, "weapon_knife" ) // add weapon for hero give_item(id,"weapon_m249") g_iMoneyHero = cs_get_user_money ( id ) cs_set_user_money ( id, 0, 0 ) message_begin( MSG_ONE, g_iMsg_HideWeapon, _, id ) write_byte( HIDE_MONEY | HIDE_TIMER ) message_end() iHealth = get_playersnum () * 5000 //iHealth = 35000 fm_set_user_health ( id, iHealth ) fm_set_user_armor ( id, iHealth ) fm_set_user_gravity( id, 0.2 ) ExecuteHamB ( Ham_Player_ResetMaxSpeed, id ) new players[32], num get_players(players, num, "ache", iTeam == 2 ? "TERRORIST" : "CT") new shakeAmplitude = __FixedUnsigned16(15.0, 1<<12) new shakeDuration = __FixedUnsigned16(4.0, 1<<12) new shakeFrequency = __FixedUnsigned16(100.0, 1<<8) for(--num; num>=0; num--) { message_begin(MSG_ONE_UNRELIABLE, g_iMsg_Snake, .player = players[num]) { write_short( shakeAmplitude ) write_short( shakeDuration ) write_short( shakeFrequency ) } message_end() } //set_lights("c") cs_set_user_nvg(id) new name[32] get_user_name(id, name, 31) set_dhudmessage ( 255, 255, 0, -1.0, 0.3, 0, 6.0, 3.0, 0.1, 1.5 ) show_dhudmessage ( 0, "Новый герой - %s у него %d HP!", name, iHealth ) client_cmd ( 0, "spk dmsentries/hero_start.wav" ) remove_task ( TASK_HUD ) set_task ( INTERVAL_TASK, "ShowHealth", TASK_HUD, .flags = "b" ) set_task ( INTERVAL_TASK_VOICE, "playvoice", TASK_HERO, .flags = "b" ) return 1 } public playvoice () { if(!g_iHero || !is_user_alive(g_iHero)) return true emit_sound(g_iHero, CHAN_VOICE, g_hSound[random(sizeof(g_hSound))], VOL_NORM, ATTN_NORM, 0, PITCH_NORM) return true } ResetHero () { if ( g_iHero && is_user_connected ( g_iHero ) ) { cs_reset_user_model ( g_iHero ) fm_set_user_rendering ( g_iHero ) } g_iHero = 0 g_iMoneyHero = 0 remove_task ( TASK_HUD ) remove_task ( TASK_HERO ) //set_lights("m") if ( g_iMsgHookCurWeapon ) { unregister_message ( g_msgCurWeapon, g_iMsgHookCurWeapon ) g_iMsgHookCurWeapon = 0 } if ( g_iMsgHookMoney ) { unregister_message ( g_msgMoney, g_iMsgHookMoney ) g_iMsgHookMoney = 0 } } public ShowHealth () { if ( !g_iHero ) { remove_task ( TASK_HUD ) return true } if(TimerHealth < get_gametime()) { set_user_health ( g_iHero ,0) ResetHero () set_dhudmessage ( g_iColors[g_iHeroTeam][0], g_iColors[g_iHeroTeam][1], g_iColors[g_iHeroTeam][2], -1.0, 0.9, 0, 0.0, INTERVAL_TASK, 0.0, 0.1 ) show_dhudmessage (0, "У героя закончился срок.") return true } static iHealth;iHealth = get_user_health ( g_iHero ) new name[32] get_user_name(g_iHero, name, 31) set_dhudmessage ( g_iColors[g_iHeroTeam][0], g_iColors[g_iHeroTeam][1], g_iColors[g_iHeroTeam][2], -1.0, 0.9, 0, 0.0, INTERVAL_TASK, 0.0, 0.1 ) show_dhudmessage (0, "Герой: %s у него %d HP | До гибели: %d секунд", name, iHealth,floatround(TimerHealth-get_gametime())) return true } public message_money(msgid, dest, id) { if(g_iHero == id) { set_pdata_int(id, OFFSET_CSMONEY, 0) set_msg_arg_int(1, ARG_LONG, 0) } } __FixedUnsigned16(Float:flValue, iScale) { new iOutput; iOutput = floatround(flValue * iScale) if ( iOutput < 0 ) iOutput = 0 if ( iOutput > 0xFFFF ) iOutput = 0xFFFF return iOutput } stock ChatColor(const id, const input[], any:...) { new count = 1, players[32] static msg[191] vformat(msg, 190, input, 3) replace_all(msg, 190, "!g", "^4") // Green Color replace_all(msg, 190, "!y", "^1") // Default Color replace_all(msg, 190, "!team", "^3") // Team Color replace_all(msg, 190, "!team2", "^0") // Team2 Color if (id) players[0] = id; else get_players(players, count, "ch") { for (new i = 0; i < count; i++) { if (is_user_connected(players[i])) { message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]) write_byte(players[i]); write_string(msg); message_end(); } } } } stock fm_set_rendering_float(entity, fx = kRenderFxNone, Float:color[3], render = kRenderNormal, Float:amount = 16.0) { set_pev(entity, pev_renderfx, fx) set_pev(entity, pev_rendercolor, color) set_pev(entity, pev_rendermode, render) set_pev(entity, pev_renderamt, amount) }
Отправить
Загрузил
fFoes4
2018-10-24 17:05:55
1
223
Установить на сервер
Скачать
Нет оплаченых серверов
Купить сервер CS 1.6
Купить сервер CS:GO
Купить сервер CSS v34
Подключить свой VDS к панели
это слитие
kolok2019
2019-01-09 15:56:29
Данная иконка означает, что плагин был проверен администрацией хостинга на тестовом сервере, и проблем с ним не было выявлено. Рекомендуем ставить исключительно проверенные плагины.
Плагин загружен на сервер, но проверка еще не была проведена.
CSHOST.COM.UA 2012-2024 Хостинг игровых серверов