AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Set C4 Glow (when is dropped) (https://forums.alliedmods.net/showthread.php?t=126434)

dFF 05-09-2010 08:13

Set C4 Glow (when is dropped)
 
Title ?

My code:
PHP Code:

#include < amxmodx >
#include < fakemeta >

#define fm_find_ent_by_class(%1,%2) engfunc( EngFunc_FindEntityByString, %1, "classname", %2 )

#define _red    255
#define _green    255
#define _blue    255
#define _alpha    25

public plugin_init()
{
    
register_forwardFM_SetModel"fw_model")
}

public 
fw_modelent )
{
    if( !
pev_valident) )
        return 
FMRES_IGNORED
    
    
while( ( ent fm_find_ent_by_classent"weapon_c4" ) ) > )
        
fm_set_renderingentkRenderFxGlowShell_red_green_blue__alpha )

    return 
FMRES_IGNORED
}

fm_set_renderingentfx kRenderFxNonergbmode=kRenderNormalamount 16 )
{
    static 
Float:RenderColor
    
RenderColor] = float)
    
RenderColor] = float)
    
RenderColor] = float)
    
    
set_peventpev_renderfxfx )
    
set_peventpev_rendercolorRenderColor )
    
set_peventpev_rendermodemode )
    
set_peventpev_renderamtfloatamount ) )


doesn't work!

hzqst 05-09-2010 08:39

Re: Set C4 Glow (when is dropped)
 
PHP Code:

public fw_modelent )
{
    if( !
pev_valident) )
        return 
FMRES_IGNORED
    
new class[24]
  
pev(entpev_classname, class, sizeof class - 1)
  if(
equal(class, "w_c4")){
        
fm_set_renderingentkRenderFxGlowShell_red_green_blue__alpha )
  }
    return 
FMRES_IGNORED



hleV 05-09-2010 10:06

Re: Set C4 Glow (when is dropped)
 
PHP Code:

public fw_modelentModel[] )
{
    if( !
pev_valident) )
        return 
FMRES_IGNORED
 
    
if (equal(Model"models/w_c4.mdl"))
        
fm_set_renderingentkRenderFxGlowShell_red_green_blue__alpha )
 
    return 
FMRES_IGNORED



dFF 05-09-2010 11:08

Re: Set C4 Glow (when is dropped)
 
Doesn't work.

Amonel 05-09-2010 15:07

Re: Set C4 Glow (when is dropped)
 
Code:

#define _red    255
#define _green    255
#define _blue    255


minimiller 05-09-2010 16:36

Re: Set C4 Glow (when is dropped)
 
dropped c4 is backpack thingame

EDIT: "models/w_backpack.mdl"

FlyingHorse 05-09-2010 16:39

Re: Set C4 Glow (when is dropped)
 
i think he means planted c4 ,not dropped..

Exolent[jNr] 05-09-2010 18:22

Re: Set C4 Glow (when is dropped)
 
Quote:

Originally Posted by FlyingHorse (Post 1175870)
i think he means planted c4 ,not dropped..

Read the topic title -_-

FlyingHorse 05-10-2010 09:39

Re: Set C4 Glow (when is dropped)
 
How do i change the glow of this code to teamcolor? So it's easier to see which guns belongs to who.. Cause this is useful for guntoss in last request plugin

xPaw 05-10-2010 09:43

Re: Set C4 Glow (when is dropped)
 
Try this

Code:
#include < amxmodx > #include < engine > enum _:GlowTypes {     Glow_Dropped,     Glow_Planted }; new g_pCvar; public plugin_init( ) {     register_plugin( "Bomb Glow", "1.0", "xPaw" );         g_pCvar = register_cvar( "bomb_glow", "3" ); // 0 - Dropped | 1 - Planted | 2 - Both         if( !find_ent_by_class( FM_NULLENT, "func_bomb_target" )     &&  !find_ent_by_class( FM_NULLENT, "info_bomb_target" ) )         pause( "a" );         register_logevent( "BombDropped", 3, "2=Dropped_The_Bomb" );     register_logevent( "BombPlanted", 3, "2=Planted_The_Bomb" ); } public BombDropped( )     if( IsEnabled( Glow_Dropped ) )         SetBombRender( find_ent_by_model( FM_NULLENT, "weaponbox", "models/w_backpack.mdl" ) ); public BombPlanted( )     if( IsEnabled( Glow_Planted ) )         SetBombRender( find_ent_by_model( FM_NULLENT, "grenade", "models/w_c4.mdl" ); SetBombRender( const iEntity ) {     if( !is_valid_ent( iEntity ) )         return;         // Your render code } bool:IsEnabled( const iType ) {     new iCvar = get_pcvar_num( g_pCvar );         return bool:( iCvar & iType ); }


All times are GMT -4. The time now is 03:44.

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