Nick: RealWolf. Grad: MembruMesaje : 379 Bani : 2532 Multumiri : 2
| Subiect: [Plugin] Becoming a Hero. Dum Iul 12, 2015 11:38 am | |
| Titlu: Becoming a Hero. Descriere: Cu acest plugin, un Anti-Furien devine Hero cand incepe runda (se alege Random Hero-ul), acesta primeste: - Cod:
-
* Dual MP5 * Deagle Gold * Katana Knife * Viteza ( 700 ) * 200 HP & 200 AP * Skin Hero
Download: http://www.fileshare.ro/e31750835 Sursa: - Cod:
-
/* Extra Event For Anti-Furiens TEAM ================================ | SkepT Jr. | ================================ Copyright © 2015, SkepT Jr. */
#include <amxmodx> #include <amxmisc> #include <CC_ColorChat> #include <cstrike> #include <fakemeta> #include <fun> #include <hamsandwich>
#define PLUGIN "[Furien] Becoming a Hero." #define VERSION "v1" #define AUTHOR "SkepT Jr."
#define is_valid_player(%1) (1 <= %1 <= 32)
/* Dual MP5 Navy */ #define weapon_dualmp5 "weapon_mp5navy" #define CSW_DUALMP5 CSW_MP5NAVY #define DUALMP5_V "models/furien/hero/v_dualmp5.mdl" #define DUALMP5_P "models/furien/hero/p_dualmp5.mdl" #define BPAMMO_DUALMP5 250 new bool:dual_mp5 [ 33 ] /* Dual MP5 Navy */
/* Deagle Gold */ #define weapon_deagle_gold "weapon_deagle" #define CSW_DEAGLE_GOLD CSW_DEAGLE #define DEAGLE_GOLD_V "models/furien/hero/v_deagle_golden.mdl" #define DEAGLE_GOLD_P "models/furien/hero/p_deagle_golden.mdl" #define BPAMMO_DEAGLE_GOLD 100 new bool:deagle_gold [ 33 ] /* Deagle Gold */
/* Katana */ #define weapon_katana "weapon_knife" #define CSW_KATANA CSW_KNIFE #define KATANA_V "models/furien/hero/v_katana.mdl" #define KATANA_P "models/furien/hero/p_katana.mdl" new bool:katana [ 33 ] /* Katana */
new const szPrefix [ ] = "[Hero]-^3" new const becoming_hero [ ] = "furien/becoming_hero.wav" new const assasinated_hero [ ] = "furien/assasinated_hero.wav" new SyncHudMessage, cvar_speed new bool:hero [ 33 ] new Ham:Ham_Player_ResetMaxSpeed = Ham_Item_PreFrame
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_event ( "HLTV", "GetRandomPlayer", "a", "1=0", "2=0") register_event ( "CurWeapon","CurrentWeapon","be","1=1" ) RegisterHam ( Ham_TakeDamage, "player", "Player_TakeDamage" ) RegisterHam ( Ham_Spawn, "player", "fwPlayerSpawn", true ) RegisterHam ( Ham_Player_ResetMaxSpeed, "player", "Ham_ResetMaxSpeedPost", true ) RegisterHam ( Ham_Killed, "player", "Ham_CBasePlayer_Killed_Post", true ) cvar_speed = register_cvar( "hero_speed", "700" ) SyncHudMessage = CreateHudSyncObj( ) // Add your code here... }
public fwPlayerSpawn ( iPlayer ) { if ( is_valid_player ( iPlayer ) && is_user_alive ( iPlayer ) ) { dual_mp5 [ iPlayer ] = false deagle_gold [ iPlayer ] = false katana [ iPlayer ] = false hero [ iPlayer ] = false cs_reset_user_model ( iPlayer ) set_user_rendering ( iPlayer ) } }
public Ham_CBasePlayer_Killed_Post( iPlayer ) { if ( is_valid_player ( iPlayer ) && is_user_alive ( iPlayer ) ) { dual_mp5 [ iPlayer ] = false deagle_gold [ iPlayer ] = false katana [ iPlayer ] = false hero [ iPlayer ] = false cs_reset_user_model ( iPlayer ) set_user_rendering ( iPlayer ) } }
public client_connect( id ){ if ( is_user_bot( id ) || is_user_hltv( id ) ) return 0 dual_mp5 [ id ] = false deagle_gold [ id ] = false katana [ id ] = false hero [ id ] = false client_cmd ( id , "cl_sidespeed 2000" ) client_cmd ( id , "cl_forwardspeed 2000" ) client_cmd ( id , "cl_backspeed 2000" ) return 0 } public GetRandomPlayer ( ) { new players [ 32 ], count get_players ( players, count, "a" ) new iPlayer = players [ random( count ) ] if ( count ) { if ( get_user_team ( iPlayer ) == 2 ) { new Name [ 32 ] get_user_name ( iPlayer, Name, charsmax ( Name ) ) client_cmd ( 0, "spk sound/%s", becoming_hero ) set_hudmessage ( 0, 255, 0, -1.0, 0.29, 0, 0.0, 3.0, 0.0, 1.0, 3 ) ShowSyncHudMsg ( 0, SyncHudMessage, "%s is now a Hero !", Name ) ColorChat ( iPlayer, GREEN, "%s Congratulations ! You was choosed to be^4 Hero^3 in this round .^4", szPrefix ) ColorChat ( 0, GREEN, "%s^4 %s^3 is now a Hero .^4", szPrefix, Name ) set_task ( 1.0, "extra_items", iPlayer ) } } }
public extra_items ( iPlayer ) { /* HP & AP */ set_user_health ( iPlayer, 200 ) set_user_armor ( iPlayer, 200 ) /* Dual MP5 & Deagle Gold & Katana */ give_item ( iPlayer, "weapon_dualmp5" ) give_item ( iPlayer, "weapon_katana" ) give_item ( iPlayer, "weapon_deagle_gold" ) cs_set_user_bpammo ( iPlayer, CSW_DUALMP5, BPAMMO_DUALMP5 ) cs_set_user_bpammo ( iPlayer, CSW_DEAGLE_GOLD, BPAMMO_DEAGLE_GOLD ) dual_mp5 [ iPlayer ] = true deagle_gold [ iPlayer ] = true katana [ iPlayer ] = true set_pev ( iPlayer, pev_viewmodel2, DUALMP5_V ) set_pev ( iPlayer, pev_weaponmodel2, DUALMP5_P ) set_pev ( iPlayer, pev_viewmodel2, DEAGLE_GOLD_V ) set_pev ( iPlayer, pev_weaponmodel2, DEAGLE_GOLD_P ) set_pev ( iPlayer, pev_viewmodel2, KATANA_V ) set_pev ( iPlayer, pev_weaponmodel2, KATANA_P ) /* Hero Model */ cs_set_user_model ( iPlayer, "hero" ) /* Model Rendering */ set_user_rendering ( iPlayer, kRenderFxGlowShell, 0, 255, 255, kRenderNormal, 25 ) /* Speed */ new speed[ 128 ] formatex ( speed, sizeof ( speed ) -1,"cl_forwardspeed %.1f;cl_sidespeed %.1f;cl_backspeed %.1f", float ( get_pcvar_num( cvar_speed ) ), float( get_pcvar_num( cvar_speed ) ), float ( get_pcvar_num( cvar_speed ) ) ) client_cmd ( iPlayer, speed ) hero [ iPlayer ] = true }
public CurrentWeapon ( iPlayer ) { if ( get_user_weapon ( iPlayer ) == CSW_DUALMP5 ) { if ( dual_mp5 [ iPlayer ] && get_user_weapon ( iPlayer ) == CSW_DUALMP5 ) { set_pev ( iPlayer, pev_viewmodel2, DUALMP5_V ) set_pev ( iPlayer, pev_weaponmodel2, DUALMP5_P ) } } if ( get_user_weapon ( iPlayer ) == CSW_DEAGLE_GOLD ) { if ( deagle_gold [ iPlayer ] && get_user_weapon ( iPlayer ) == CSW_DEAGLE_GOLD ) { set_pev ( iPlayer, pev_viewmodel2, DEAGLE_GOLD_V ) set_pev ( iPlayer, pev_weaponmodel2, DEAGLE_GOLD_P ) } } if ( get_user_weapon ( iPlayer ) == CSW_KATANA ) { if ( katana [ iPlayer ] && get_user_weapon ( iPlayer ) == CSW_KATANA ) { set_pev ( iPlayer, pev_viewmodel2, KATANA_V ) set_pev ( iPlayer, pev_weaponmodel2, KATANA_P ) } } }
public plugin_precache ( ) { precache_model ( DUALMP5_V ) precache_model ( DUALMP5_P ) precache_model ( DEAGLE_GOLD_V ) precache_model ( DEAGLE_GOLD_P ) precache_model ( KATANA_V ) precache_model ( KATANA_P ) precache_sound ( becoming_hero ) precache_sound ( assasinated_hero ) precache_model ( "models/player/hero/hero.mdl" ) }
public Player_TakeDamage ( iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits ) { if ( is_valid_player ( iAttacker ) ) { if ( iInflictor == iAttacker && katana [ iAttacker ] && is_user_alive ( iAttacker ) && get_user_weapon ( iAttacker ) == CSW_KATANA && get_user_team ( iAttacker ) == 1 ) { SetHamParamFloat ( 4, fDamage * 1.7) return HAM_HANDLED } if ( iInflictor == iAttacker && dual_mp5 [ iAttacker ] && is_user_alive ( iAttacker ) && get_user_weapon ( iAttacker ) == CSW_DUALMP5 && get_user_team ( iAttacker ) == 2 ) { SetHamParamFloat ( 4, fDamage * 3.0) return HAM_HANDLED } if ( iInflictor == iAttacker && deagle_gold [ iAttacker ] && is_user_alive ( iAttacker ) && get_user_weapon ( iAttacker ) == CSW_DEAGLE_GOLD && get_user_team ( iAttacker ) == 2 ) { SetHamParamFloat ( 4, fDamage * 2.5) return HAM_HANDLED } } return HAM_IGNORED } public Ham_ResetMaxSpeedPost ( iPlayer ) { if ( is_user_alive ( iPlayer ) && is_user_connected ( iPlayer ) && get_user_maxspeed ( iPlayer ) != 1.0 ) { new Float:flMaxSpeed if ( hero[ iPlayer ] ) { flMaxSpeed = float ( get_pcvar_num ( cvar_speed ) ) } if ( flMaxSpeed > 0.0 ) { set_pev ( iPlayer, pev_maxspeed, flMaxSpeed ) } } }
public evDeathMsg ( ) { new iKiller = read_data ( 1 ) new iVictim = read_data ( 2 )
if ( !is_user_connected ( iKiller ) || !is_user_connected ( iVictim ) || iKiller == iVictim ) return 1 if ( hero [ iVictim ] ) { ColorChat ( 0, GREEN, "%s^4 %s^3 was killed by ^4%s ^3.^4", szPrefix, get_name ( iVictim ), get_name ( iKiller ) ) set_hudmessage ( 0, 255, 0, -1.0, 0.29, 0, 0.0, 3.0, 0.0, 1.0, 3 ) ShowSyncHudMsg ( 0, SyncHudMessage, "The Hero %s was assasinated !", get_name ( iVictim ) ) client_cmd ( 0, "spk sound/%s", assasinated_hero ) } return 0 }
stock get_name ( id ) { new name [ 32 ] get_user_name ( id, name, sizeof ( name ) -1 ) return name }
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1066\\ f0\\ fs16 \n\\ par } */
Nume: Becoming a Hero Versiunea: V1 Instalare: 1. Compilam sursa 2. Fisierul nume_plugin.sma il puneti in addons/amxmodx/scripting 3. Fisierul nume_plugin.amxx il puneti in addons/amxmodx/plugins 4. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma: - Cod:
-
nume_plugin.amxx Cvars:-
|
|