Sam Oct 26, 2013 12:28 pmSilver™Sam Oct 26, 2013 12:28 pm
Silver™
Silver™
User
Descriere:Ultimul jucator de la Furieni/AntiFurieni primeste viata, armura ,viteza si o putere specifica.Kage (Furien) primeste abilitatea de a arunca cu flacari iar Psycho (AntiFurien) primeste machinegun.
Download link:
Versiune: 2.1
Instalare:
Comenzi administrative:
Cvar's:
Pluginul bindeaza automat comanda fire pe tasta X
Imagina (Daca e necesar):
Download link:
- furien_kagevspsycho.sma:
- Cod:
/*
Plugin: [Furien] Kage vs Psycho
Versiune: 2.1
Autori: Askhanar (codul original)
KronoS # GG (infrumusetarea codului , optimizare si implementarea puterilor)
Credite: cheap_suit (flamethrower)
Cvar-uri:
fmp_psycho_hp 250 [viata care o primeste psycho]
fmp_psycho_ap 300 [armura care o primeste psycho]
fmp_psycho_speed 600 [viteza care o primeste psycho]
fmp_kage_hp 300 [viata care o primeste kage]
fmp_kage_ap 300 [armura care o primeste kage]
fmp_kage_speed 900 [viteza care o primeste kage]
fmp_kage_flames 20 [numarul de flacari care pot fi aruncate de kage]
fmp_kage_flames_dmg 30 [damage-ul pe care il face o flacara]
Informatii:
Comanda pentru a arunca cu flacari este fire (in consola)
Pluginul bindeaza automat comanda fire pe tasta X
*/
#include < amxmodx >
#include < fun >
#include < cstrike >
#include < hamsandwich >
#include < fakemeta >
#include < engine >
#include < xs >
#include < colorchat >
#pragma semicolon 1
#define PLUGIN "[Furien] Kage vs Psycho"
#define VERSION "2.1"
new const KageSound[ ] = "thunder.wav";
new const PsychoSound[ ] = "thunder.wav";
new bool:UserIsKage[ 33 ], bool:UserIsPsycho[ 33 ];
new cvar_hp, cvar_ap, cvar_speed, cvar_hp2, cvar_ap2, cvar_speed2, cvar_flames, cvar_dmg;
new SyncHudMessage, sprite_fire, sprite_burn;
new g_ThrowFlames[ 33 ], flame_count[ 33 ];
public plugin_cfg( )
set_cvar_float( "sv_maxspeed", 1000.0 );
public plugin_precache( )
{
precache_sound KageSound ;
precache_sound PsychoSound ;
sprite_fire = precache_model( "sprites/explode1.spr" );
sprite_burn = precache_model( "sprites/xfire.spr" );
precache_sound( "flamethrower.wav" );
}
public plugin_init( )
{
register_plugin PLUGIN, VERSION, "Askhanar & KronoS # GG" ;
cvar_hp = register_cvar( "fmp_psycho_hp", "250" );
cvar_ap = register_cvar( "fmp_psycho_ap", "300" );
cvar_speed = register_cvar( "fmp_psycho_speed", "600" );
cvar_hp2 = register_cvar( "fmp_kage_hp", "300" );
cvar_ap2 = register_cvar( "fmp_kage_ap", "300" );
cvar_speed2 = register_cvar( "fmp_kage_speed", "900" );
cvar_flames = register_cvar( "fmp_kage_flames", "20" );
cvar_dmg = register_cvar( "fmp_kage_flames_dmg", "30" );
register_clcmd( "fire", "amx_fflame" );
register_event( "DeathMsg", "evDeathMsg", "a" );
register_event( "CurWeapon", "Ham_ResetMaxSpeedPost", "be", "1=1" );
SyncHudMessage = CreateHudSyncObj( );
}
public client_connect( id )
{
if ( is_user_bot( id ) || is_user_hltv( id ) )
return 0;
UserIsKage[ id ] = false;
UserIsPsycho[ id ] = false;
g_ThrowFlames[ id ] = 0;
flame_count[ id ] = 0;
client_cmd( id , "cl_sidespeed 1000" );
client_cmd( id , "cl_forwardspeed 1000" );
client_cmd( id , "cl_backspeed 1000" );
client_cmd( id , "bind x fire" );
return 0;
}
public client_disconnect( id )
{
if ( is_user_bot( id ) || is_user_hltv( id ) )
return 0;
UserIsKage[ id ] = false;
UserIsPsycho[ id ] = false;
g_ThrowFlames[ id ] = 0;
flame_count[ id ] = 0;
client_cmd( id , "cl_sidespeed 400" );
client_cmd( id , "cl_forwardpeed 400" );
client_cmd( id , "cl_backspeed 400" );
return 0;
}
public SearchForPsycho( )
{
new iTerro = CountPlayers( 1 );
new iCounter = CountPlayers( 2 );
if ( iCounter == 1 && iTerro > 0 )
{
new id = GetRemainingPlayerId( 2 );
if ( UserIsPsycho[ id ] )
return 1;
UserIsPsycho[ id ] = true;
ColorChat( 0, RED,"^x04[AntiFurien]^x03 %s^x01 a devenit^x03 Psycho^x01 ! ", get_name( id ) );
ColorChat( 0, RED,"^x04[AntiFurien]^x01 Are^x03 %d^x01 HP,^x03 %d^x01 AP,^x03 %d^x01 Speed, aveti grija !", get_pcvar_num( cvar_hp ), get_pcvar_num( cvar_ap ), get_pcvar_num( cvar_speed ) );
set_hudmessage( 0, 255, 0, -1.0, -1.0, 0, 0.0, 5.0, 0.0, 1.0, 3);
ShowSyncHudMsg( 0, SyncHudMessage, "%s a devenit Psycho !^n Cea din urma salvare a omenirii !", get_name( id ) );
set_user_maxspeed( id, float( get_pcvar_num( cvar_speed ) ) );
set_user_health( id, get_pcvar_num( cvar_hp ) );
set_user_armor( id, get_pcvar_num( cvar_ap ) );
set_task( 1.0, "give_weapon", id );
set_user_rendering( id, kRenderFxGlowShell, 0, 255, 255, kRenderNormal, 25 );
new szCommand[ 128 ];
formatex( szCommand, sizeof( szCommand ) - 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( id, szCommand );
client_cmd( 0, "spk sound/%s", PsychoSound );
}
return 0;
}
public give_weapon( id )
{
if ( is_user_alive( id ) && UserIsPsycho[ id ] )
{
give_item( id, "weapon_m249" );
cs_set_user_bpammo( id, CSW_M249, 200 );
}
}
public SearchForKage( )
{
new iTerro = CountPlayers( 1 );
new iCounter = CountPlayers( 2 );
if ( iTerro == 1 && iCounter > 0 )
{
new id = GetRemainingPlayerId( 1 );
if ( UserIsKage[ id ] )
return 1;
UserIsKage[ id ] = true;
ColorChat( 0, RED,"^x04[Furien]^x03 %s^x01 s-a transformat in^x03 Kage^x01 ! ", get_name( id ));
ColorChat( 0, RED,"^x04[Furien]^x01 Are^x03 %d^x01 HP,^x03 %d^x01 AP,^x03 %d^x01 Speed, aveti grija !", get_pcvar_num( cvar_hp2 ), get_pcvar_num( cvar_ap2 ), get_pcvar_num( cvar_speed2 ) );
set_hudmessage( 0, 255, 0, -1.0, -1.0, 0, 0.0, 5.0, 0.0, 1.0, 3);
ShowSyncHudMsg( 0, SyncHudMessage, "%s s-a transformat in Kage !^nSansele pamantenilor au scazut !", get_name( id ) );
g_ThrowFlames[ id ] = 1;
flame_count[ id ] = get_pcvar_num( cvar_flames );
set_user_maxspeed( id, float( get_pcvar_num( cvar_speed2 ) ) );
set_user_health( id, get_pcvar_num( cvar_hp2 ) );
set_user_armor( id, get_pcvar_num( cvar_ap2 ) );
new szCommand[ 128 ];
formatex( szCommand, sizeof( szCommand ) - 1, "cl_forwardspeed %.1f;cl_sidespeed %.1f;cl_backspeed %.1f",
float( get_pcvar_num( cvar_speed2 ) ), float( get_pcvar_num( cvar_speed2 ) ),
float( get_pcvar_num( cvar_speed2 ) ) );
client_cmd( id, szCommand );
client_cmd( 0, "spk sound/%s", KageSound );
}
return 0;
}
public evDeathMsg( )
{
SearchForPsycho( );
SearchForKage( );
new iKiller = read_data( 1 );
new iVictim = read_data( 2 );
if ( !is_user_connected( iKiller ) || !is_user_connected( iVictim ) || iKiller == iVictim )
return 1;
if ( UserIsKage[ iVictim ] )
{
ColorChat( 0, RED, "^x04[AntiFurien]^x01 Kage^x03 %s^x01 a fost omorat de^x03 %s^x01 !", get_name( iVictim ), get_name( iKiller ) );
UserIsKage[ iVictim ] = false;
g_ThrowFlames[ iVictim ] = 0;
flame_count[ iVictim ] = 0;
}
else if ( UserIsPsycho[ iVictim ] )
{
ColorChat( 0, RED, "^x04[Furien]^x01 Psycho^x03 %s^x01 a fost omorat de^x03 %s^x01 !", get_name( iVictim ), get_name( iKiller ) );
UserIsPsycho[ iVictim ] = false;
}
if ( UserIsKage[ iKiller ] && UserIsPsycho[ iVictim ] )
{
UserIsKage[ iKiller ] = false;
g_ThrowFlames[ iKiller ] = 0;
flame_count[ iKiller ] = 0;
set_user_armor( iKiller, 0 );
client_cmd( iKiller, "lastinv" );
client_cmd( iKiller, "lastinv" );
strip_user_weapons iKiller ;
give_item( iKiller, "weapon_knife" );
}
else if ( UserIsPsycho[ iKiller ] && UserIsKage[ iVictim ] )
{
UserIsPsycho[ iKiller ] = false;
set_user_armor( iKiller, 0 );
set_user_rendering iKiller ;
client_cmd( iKiller, "lastinv" );
client_cmd( iKiller, "lastinv" );
strip_user_weapons iKiller ;
give_item( iKiller, "weapon_knife" );
}
return 0;
}
public Ham_ResetMaxSpeedPost( id )
{
if ( is_user_alive( id ) && get_user_maxspeed( id ) != 1.0 && ( UserIsPsycho[ id ] || UserIsKage[ id ] ) )
{
new Float:flMaxSpeed;
if ( UserIsPsycho[ id ] )
flMaxSpeed = float( get_pcvar_num( cvar_speed ) );
else if ( UserIsKage[ id ] )
flMaxSpeed = float( get_pcvar_num( cvar_speed2 ) );
if ( flMaxSpeed > 0.0 )
set_pev( id, pev_maxspeed, flMaxSpeed );
}
}
stock CountPlayers( const Team )
{
new iPlayers[ 32 ];
new iPlayersNum;
new iPlayersCount;
get_players( iPlayers, iPlayersNum, "ch" );
for ( new i = 0 ; i < iPlayersNum ; i++ )
{
if ( is_user_alive( iPlayers[ i ] ) )
{
if ( Team == 1 )
{
if ( get_user_team( iPlayers[ i ] ) == 1 )
iPlayersCount++;
}
else if ( Team == 2 )
{
if ( get_user_team( iPlayers[ i ] ) == 2 )
iPlayersCount++;
}
}
}
return iPlayersCount;
}
stock GetRemainingPlayerId( const Team )
{
new iPlayers[ 32 ];
new iPlayersNum;
new iPlayerId;
get_players( iPlayers, iPlayersNum, "ch" );
for ( new i = 0 ; i < iPlayersNum ; i++ )
{
if ( is_user_alive( iPlayers[ i ] ) )
{
if ( Team == 1 )
{
if ( get_user_team( iPlayers[ i ] ) == 1 )
iPlayerId = iPlayers[ i ];
}
else if ( Team == 2 )
{
if ( get_user_team( iPlayers[ i ] ) == 2 )
iPlayerId = iPlayers[ i ];
}
}
}
return iPlayerId;
}
public amx_fflame( id )
{
if ( is_user_alive( id ) == 0)
return PLUGIN_HANDLED;
if ( flame_count[ id ] < 1 )
return PLUGIN_HANDLED;
if ( !g_ThrowFlames[ id ] )
return PLUGIN_HANDLED;
new Float:fOrigin[ 3 ], Float:fVelocity[ 3 ];
entity_get_vector( id,EV_VEC_origin, fOrigin );
VelocityByAim( id, 35, fVelocity );
new Float:fTemp[ 3 ], iFireOrigin[ 3 ];
xs_vec_add( fOrigin, fVelocity, fTemp );
FVecIVec( fTemp, iFireOrigin );
new Float:fFireVelocity[ 3 ], iFireVelocity[ 3 ];
VelocityByAim( id, 100, fFireVelocity );
FVecIVec( fFireVelocity, iFireVelocity );
create_flames_n_sounds( id, iFireOrigin, iFireVelocity );
direct_damage( id );
flame_count[ id ] -= 1;
return PLUGIN_HANDLED;
}
public create_flames_n_sounds( id, origin[ 3 ], velocity[ 3 ] )
{
message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
write_byte( 120 );
write_coord( origin[ 0 ] );
write_coord( origin[ 1 ] );
write_coord( origin[ 2 ] );
write_coord( velocity[ 0 ] );
write_coord( velocity[ 1 ] );
write_coord( velocity[ 2 ] + 5 );
write_short( sprite_fire );
write_byte( 1 );
write_byte( 10 );
write_byte( 1);
write_byte( 5 );
message_end( );
emit_sound( id, CHAN_WEAPON, "flamethrower.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
}
public direct_damage( id )
{
new ent, body;
get_user_aiming( id, ent, body, 600 ) ;
if ( ent > 0 && is_user_alive( ent ) )
{
if ( get_user_team( id ) != get_user_team( ent ) )
damage_user( id, ent, get_pcvar_num( cvar_dmg ) );
}
}
stock damage_user( id, victim, damage )
{
new iHealth = get_user_health( victim );
if ( iHealth > damage )
set_user_health( victim, iHealth - damage );
else
{
user_silentkill( victim );
make_deathmsg( id, victim, 0, "flamethrower" );
new iOrigin[ 3 ];
get_user_origin( victim, iOrigin, 0 );
message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
write_byte( 17 );
write_coord( iOrigin[ 0 ] );
write_coord( iOrigin[ 1 ] );
write_coord( iOrigin[ 2 ] + 10 );
write_short( sprite_burn );
write_byte( 30 );
write_byte( 40 );
message_end( );
if ( get_user_team( id ) != get_user_team( victim ) )
{
set_user_frags( id, get_user_frags( id ) + 1 );
cs_set_user_money( id, cs_get_user_money( id ) + 300 );
}
message_begin( MSG_ALL, get_user_msgid( "ScoreInfo" ) );
write_byte( id );
write_short( get_user_frags( id ) );
write_short( get_user_deaths( id ) );
write_short( 0);
write_short( get_user_team( id ) );
message_end();
message_begin( MSG_ALL, get_user_msgid( "ScoreInfo" ) );
write_byte( victim );
write_short( get_user_frags( victim ) );
write_short( get_user_deaths( victim ) );
write_short( 0 );
write_short( get_user_team( victim ) );
message_end( );
}
}
stock get_name( id )
{
new name[ 32 ];
get_user_name( id, name, sizeof ( name ) -1 );
return name;
}
Versiune: 2.1
Instalare:
Comenzi administrative:
Cvar's:
- Cod:
fmp_psycho_hp 250 ;[viata care o primeste psycho]
fmp_psycho_ap 300 ;[armura care o primeste psycho]
fmp_psycho_speed 600 ;[viteza care o primeste psycho]
fmp_kage_hp 300 ;[viata care o primeste kage]
fmp_kage_ap 300 ;[armura care o primeste kage]
fmp_kage_speed 900 ;[viteza care o primeste kage]
fmp_kage_flames 20 ;[numarul de flacari care pot fi aruncate de kage]
fmp_kage_flames_dmg 30 ;[damage-ul pe care il face o flacara]
Pluginul bindeaza automat comanda fire pe tasta X
Imagina (Daca e necesar):