Raised This Month: $ Target: $400
 0% 

[REQ] This plugin convert.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-24-2011 , 08:11   Re: [REQ] This plugin convert.
Reply With Quote #3

Try
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <fun>
#include <engine>
#include <hamsandwich>

#define TASK_AURA 32
#define TASK_STOPELECTRO 64

const XO_WEAPON 4
const m_pPlayer 41

new ElectroSprg_electro[33], cvar_aura_colors[3]
new 
g_iMaxPlayersg_msgScreenFade

new cvar_aura_size
const UNIT_SECOND = (1<<12

public 
plugin_init() 
{
    
register_plugin("Electro Weapon""1.2""Zapdos1")
    
cvar_aura_size register_cvar("zp_aura_size""50")

    
register_event("HLTV""Event_HLTV_New_Round""a""1=0""2=0")
    
RegisterHam(Ham_Item_Deploy"weapon_mp5navy""CMP5N_Deploy_Post"true)
    
RegisterHam(Ham_Item_Holster"weapon_mp5navy""CBasePlayerWeapon_Holster_MP5_P"true)
    
RegisterHam(Ham_TakeDamage"player""CBasePlayer_TakeDamage"false)

    
cvar_aura_colors[0] = register_cvar("zp_aura_red""255")
    
cvar_aura_colors[1] = register_cvar("zp_aura_green""255")
    
cvar_aura_colors[2] = register_cvar("zp_aura_blue""0")

    
g_iMaxPlayers get_maxplayers()
    
g_msgScreenFade get_user_msgid("ScreenFade")
}

public 
plugin_precache() 
{
    
precache_model("models/zombie_plague/v_electro.mdl"); 
    
precache_sound("zombie_plague/spark6.wav");
    
ElectroSpr precache_model("sprites/spark1.spr");
}

public 
Event_HLTV_New_Round()
{
    
arrayset(g_electrofalsesizeof(g_electro))
    for (new 
1<= g_iMaxPlayersi++)
    {
        
remove_task(TASK_AURA)
        
remove_task(TASK_STOPELECTRO)
    }
}

public 
CBasePlayer_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
    if( 
attacker && attacker == inflictor && attacker != victim && get_user_weapon(attacker) == CSW_MP5NAVY )
    {
        
SetHamParamInteger(5damage_type DMG_SHOCK)
        new 
Float:origin[3]
        
pev(victimpev_originorigin)
        
ElectroEffect(victim)
        
ElectroRing(origin
        
ElectroSound(origin)
    }
}

public 
CMP5N_Deploy_PostiMP5 )
{
    new 
id get_pdata_cbase(iMP5m_pPlayerXO_WEAPON)
    
set_pev(idpev_viewmodel2"models/zombie_plague/v_electro.mdl")
    
remove_task(id TASK_AURA)
    
set_task(0.1"electro_aura"id TASK_AURA__"b")
    
set_user_rendering(idkRenderFxGlowShell2552550kRenderTransAlpha255
}

public 
CBasePlayerWeapon_Holster_MP5_P(iMP5 )
{
    new 
id get_pdata_cbase(iMP5m_pPlayerXO_WEAPON)
    
remove_task(id TASK_AURA)
    
set_user_rendering(id_000_0)
}

ElectroSound(Float:flOrigin[3])
{
    new 
Entity create_entity("info_target")
    
entity_set_origin(EntityflOrigin)
    
emit_sound(EntityCHAN_WEAPON"zombie_plague/spark6.wav"VOL_NORMATTN_NORM0PITCH_NORM)
    
remove_entity(Entity)
}

ElectroRing(const Float:originF3[3])
{
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF30)
    
write_byte(TE_BEAMCYLINDER
    
engfunc(EngFunc_WriteCoordoriginF3[0]) 
    
engfunc(EngFunc_WriteCoordoriginF3[1]) 
    
engfunc(EngFunc_WriteCoordoriginF3[2]) 
    
engfunc(EngFunc_WriteCoordoriginF3[0])
    
engfunc(EngFunc_WriteCoordoriginF3[1]) 
    
engfunc(EngFunc_WriteCoordoriginF3[2]+100.0
    
write_short(ElectroSpr
    
write_byte(0)
    
write_byte(0
    
write_byte(4
    
write_byte(60)
    
write_byte(0
    
write_byte(41
    
write_byte(138
    
write_byte(255
    
write_byte(200)
    
write_byte(0
    
message_end()
}

ElectroEffect(id)
{
    if (!
is_user_alive(id) || g_electro[id])
        return;
    
    
message_begin(MSG_ONE_UNRELIABLEg_msgScreenFade_id)
    
write_short(UNIT_SECOND*1)
    
write_short(UNIT_SECOND*1
    
write_short(0x0000
    
write_byte(255
    
write_byte(255
    
write_byte(0
    
write_byte(100
    
message_end()

    
set_user_rendering(idkRenderFxGlowShell2502500kRenderNormal25)

    
g_electro[id] = true
    set_task
(5.0"stopelectro"id+TASK_STOPELECTRO
}

public 
stopelectro(id)
{
    
id -= TASK_STOPELECTRO
    
if (!is_user_alive(id) || !g_electro[id])
        return;
        
    
g_electro[id] = false;

    
set_user_rendering(id_000_0)
}

public 
client_putinserver(id)
{
    
g_electro[id] = false 
}

public 
client_disconnect(id)
{
    
g_electro[id] = false
    remove_task
(id TASK_AURA)
    
remove_task(id TASK_STOPELECTRO)
}

public 
electro_aura(id)
{
    
id -= TASK_AURA

    
if (!is_user_alive(id))
        return
        
    static 
Float:FOrigin[3]
    
pev(idpev_originFOrigin)
        
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYFOrigin0
    
write_byte(TE_DLIGHT
    
engfunc(EngFunc_WriteCoordFOrigin[0]) 
    
engfunc(EngFunc_WriteCoordFOrigin[1]) 
    
engfunc(EngFunc_WriteCoordFOrigin[2]) 
    
write_byte(get_pcvar_num(cvar_aura_size)) 
    
write_byte(get_pcvar_num(cvar_aura_colors[0])) 
    
write_byte(get_pcvar_num(cvar_aura_colors[1])) 
    
write_byte(get_pcvar_num(cvar_aura_colors[2])) 
    
write_byte(2
    
write_byte(0
    
message_end()     

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:59.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode