PHP- Kodu:
#include < amxmodx >
#include < hamsandwich >
#include < hlsdk_const >
new szVersion[ ] = "1.1";
new szAuthor[ ] = "Asd'";
new AuraEnable;
new AuraRadius;
new AuraModes;
new AuraColors;
new szColors[ 33 ];
new szRed[ 4 ];
new szGreen[ 4 ];
new szBlue[ 4 ];
public plugin_init( )
{
register_plugin( "AuraDamage", szVersion, szAuthor );
AuraEnable = register_cvar( "amx_auraenable", "1" );
AuraRadius = register_cvar( "amx_auraradius", "20" );
AuraColors = register_cvar( "amx_auracolors", "0 250 0" );
AuraModes = register_cvar( "amx_auramodes", "3" );
RegisterHam( Ham_TakeDamage, "player", "Forward_TakeDamage" );
register_cvar( "ad_author", szAuthor, FCVAR_SERVER|FCVAR_SPONLY );
register_cvar( "ad_version", szVersion, FCVAR_SERVER|FCVAR_SPONLY );
}
public Forward_TakeDamage( Victim, Inflictor, Attacker, Float:Damage, iDamageBits )
{
if( !get_pcvar_num( AuraEnable ) )
return HAM_IGNORED;
if( iDamageBits == DMG_FALL )
return HAM_IGNORED;
if( Attacker == Victim )
return HAM_IGNORED;
new TeamVictim = get_user_team( Victim );
new TeamAttacker = get_user_team( Attacker );
if( TeamAttacker == TeamVictim )
return HAM_IGNORED;
new OriginIndex[ 3 ];
get_user_origin( Victim, OriginIndex );
message_begin( MSG_PVS, SVC_TEMPENTITY, OriginIndex, 0 );
write_byte( TE_DLIGHT );
write_coord( OriginIndex[ 0 ] );
write_coord( OriginIndex[ 1 ] );
write_coord( OriginIndex[ 2 ] );
write_byte( get_pcvar_num( AuraRadius ) );
switch( get_pcvar_num( AuraModes ) )
{
case 0:
{
write_byte( 250 );
write_byte( 250 );
write_byte( 250 );
}
case 1:
{
get_pcvar_string( AuraColors, szColors, 32 );
parse( szColors, szRed, 3, szGreen, 3, szBlue, 3 );
new iRed = clamp( str_to_num( szRed ), 0, 250 );
new iGreen = clamp( str_to_num( szGreen ), 0, 250 );
new iBlue = clamp( str_to_num( szBlue ), 0, 250 );
write_byte( iRed );
write_byte( iGreen );
write_byte( iBlue );
}
case 2:
{
write_byte( random_num( 0, 250 ) );
write_byte( random_num( 0, 250 ) );
write_byte( random_num( 0, 250 ) );
}
case 3:
{
if ( TeamVictim == 1 )
{
write_byte( 250 );
write_byte( 0 );
write_byte( 0 );
}
else
{
write_byte( 0 );
write_byte( 0 );
write_byte( 250 );
}
}
}
write_byte( 50 );
write_byte( 100 );
message_end( );
return HAM_IGNORED;
}