PremiumCs
VA AJUTAM CU ORICE PROBLEMA DOAR FACETI-VA CONT !


CAUTAM SERVERE DE ORICE FEL+VA OFERIM AJUTOR DACA E VORBA DESPRE CS/SAU VIATA DE ZI CU ZI!
 
AcasaAcasa  CalendarCalendar  GalerieGalerie  FAQFAQ  MembriMembri  GrupuriGrupuri  InregistrareInregistrare  ConectareConectare  

SPER SA ITI PLACA COMUNITATEA SPUNE CELORLATI !

Distribuiţi | 
 

 Plugin kage vs Psyho

In jos 
AutorMesaj
Vizitator
Vizitator
avatar


MesajSubiect: Plugin kage vs Psyho   Dum Mai 11, 2014 5:32 am

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.

Autori:
Askhanar - codul original
KronoS # GG - infrumusetarea codului , optimizare si implementarea puterilor

Credite:
cheap_suit - flamethrower

Descarcare:
furien_kagevspsycho.sma | Ascunde codul
/*

Plugin: [Furien] Kage vs Psycho
Versiune: 2.2-beta2

Autori: Askhanar (codul original)
KronoS # GG (infrumusetarea codului , optimizare si implementarea puterilor)

Credite: cheap_suit (flamethrower)
ConnorMcLeod (citirea vitezei unui furien)

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:

Pluginul este compatibil doar cu modul furien scris de ConnorMcLeod
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.2-beta2"

new const KageSound[ ] = "thunder.wav";
new const PsychoSound[ ] = "thunder.wav";

new bool:UserIsKage[ 33 ], bool:UserIsPsycho[ 33 ], Float:g_flMaxSpeed;

new cvar_hp, cvar_ap, cvar_speed, cvar_hp2, cvar_ap2, cvar_speed2, cvar_flames, cvar_dmg;

new SyncHudMessage, g_MaxPlayers, sprite_fire, sprite_burn;

new g_ThrowFlames[ 33 ], flame_count[ 33 ];

public plugin_cfg( )
set_cvar_float( "sv_maxspeed", 1000.0 );

public plugin_precache( )
{
if( !ReadCfgFile() )
{
log_amx( "[Furien] Configuration file doesn't exist!" );
}

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", "Event_CurWeapon", "be", "1=1" );
register_logevent( "Event_RoundEnd", 2, "1=Round_End" );

SyncHudMessage = CreateHudSyncObj( );
g_MaxPlayers = get_maxplayers( );
}

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 Event_RoundEnd( )
{
for ( new i = 0 ; i < g_MaxPlayers ; i++ )
{
if ( UserIsKage[ i ] )
{
UserIsKage[ i ] = false;
g_ThrowFlames[ i ] = 0;
flame_count[ i ] = 0;
set_pev( i, pev_maxspeed, g_flMaxSpeed );
}
else if ( UserIsPsycho[ i ] )
{
UserIsPsycho[ i ] = false;

set_user_rendering i ;
}
}
}

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;
}

return 0;
}

public Event_CurWeapon( 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;
}

ReadCfgFile( )
{
new szConfigFile[ 128 ];
get_localinfo( "amxx_configsdir", szConfigFile, charsmax( szConfigFile ) );
format( szConfigFile, charsmax( szConfigFile ), "%s/furien/furien.ini", szConfigFile );

new fp = fopen( szConfigFile, "rt" );
if ( !fp )
{
return false;
}

new szDatas[ 96 ], szKey[ 16 ], szValue[ 64 ];
while ( !feof(fp) )
{
fgets( fp, szDatas, charsmax( szDatas ) );
trim( szDatas );
if ( !szDatas[ 0 ] || szDatas[ 0 ] == ';' || szDatas[ 0 ] == '#' || ( szDatas[ 0 ] == '/' && szDatas[ 1 ] == '/' ) )
{
continue;
}

parse( szDatas, szKey, charsmax( szKey ), szValue, charsmax( szValue ) );

switch ( szKey[ 0 ] )
{
case 'M':
{
if ( equal(szKey, "MAXSPEED") )
{
g_flMaxSpeed = floatclamp( str_to_float( szValue ), 100.0, 2000.0 );
}
}
}
}
fclose( fp );

return 1;
}

Fisiere necesare:
colorchat.inc
colorchat.inc | Ascunde codul
/* Fun functions
*
* by Numb
*
* This file is provided as is (no warranties).
*/

#if defined _colorchat_included
#endinput
#endif
#define _colorchat_included

enum Color
{
NORMAL = 1, // clients scr_concolor cvar color
GREEN, // Green Color
TEAM_COLOR, // Red, grey, blue
GREY, // grey
RED, // Red
BLUE, // Blue
}

new const TeamName[][] =
{
"",
"TERRORIST",
"CT",
"SPECTATOR"
}

ColorChat(id, Color:type, const msg[], any:...)
{
new message[256];

switch(type)
{
case NORMAL: // clients scr_concolor cvar color
{
message[0] = 0x01;
}
case GREEN: // Green
{
message[0] = 0x04;
}
default: // White, Red, Blue
{
message[0] = 0x03;
}
}

vformat(message[1], 251, msg, 4);

// Make sure message is not longer than 192 character. Will crash the server.
message[192] = '^0';

new team, ColorChange, index, MSG_Type;

if(id)
{
MSG_Type = MSG_ONE_UNRELIABLE;
index = id;
} else {
index = FindPlayer();
MSG_Type = MSG_BROADCAST;
}

team = get_user_team(index);
ColorChange = ColorSelection(index, MSG_Type, type);

ShowColorMessage(index, MSG_Type, message);

if(ColorChange)
{
Team_Info(index, MSG_Type, TeamName[team]);
}
}

ShowColorMessage(id, type, message[])
{
static msgSayText;
if(!msgSayText)
{
msgSayText = get_user_msgid("SayText");
}
message_begin(type, msgSayText, _, id);
write_byte(id)
write_string(message);
message_end();
}

Team_Info(id, type, team[])
{
static msgTeamInfo;
if(!msgTeamInfo)
{
msgTeamInfo = get_user_msgid("TeamInfo");
}
message_begin(type, msgTeamInfo, _, id);
write_byte(id);
write_string(team);
message_end();

return 1;
}

ColorSelection(index, type, Color:Type)
{
switch(Type)
{
case RED:
{
return Team_Info(index, type, TeamName[1]);
}
case BLUE:
{
return Team_Info(index, type, TeamName[2]);
}
case GREY:
{
return Team_Info(index, type, TeamName[0]);
}
}

return 0;
}

FindPlayer()
{
new i = -1;

while(i <= get_maxplayers())
{
if(is_user_connected(++i))
return i;
}

return -1;
}

Cvar-uri:
Citat:
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:
Pluginul este compatibil doar cu modul furien scris de ConnorMcLeod
Bind-ul pentru a arunca cu flacari este fire (in consola)
Pluginul bindeaza automat comanda fire pe tasta X
Sus In jos
 
Plugin kage vs Psyho
Sus 
Pagina 1 din 1

Permisiunile acestui forum:Nu puteti raspunde la subiectele acestui forum
PremiumCs :: Counter-Strike 1.6 :: Pluginuri :: PLUGINURI FURIEN-
Mergi direct la: