Raised This Month: $51 Target: $400
 12% 

[L4D1] how to fix Tank glow


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ttfak12
Junior Member
Join Date: Mar 2016
Old 12-18-2019 , 01:40   [L4D1] how to fix Tank glow
Reply With Quote #1

Hi everyone,
how to fix Tank glow

PHP Code:
public OnMapStart()
{
    
PrecacheModel("models/infected/hulk.mdl");
}

public 
Event_TankSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{    
    new 
TankID GetEventInt(event"tankid");
    
TankGlow(TankID);
}

TankGlow(tank)
{
    
decl Float:TPos[3], Float:TAng[3], String:TTeam[4];
    
GetEntPropVector(tankProp_Data"m_vecOrigin"TPos);
    
GetEntPropVector(tankProp_Send"m_angRotation"TAng);
    new 
prop CreateEntityByName("prop_glowing_object");
    
    if (
prop != 1) {
        
        
DispatchKeyValue(prop"model""models/infected/hulk.mdl");
        
DispatchKeyValue(prop"StartGlowing""1");
        
        
GetConVarString(hWGlowTeamTTeamsizeof(TTeam));
        
DispatchKeyValue(prop"GlowForTeam"TTeam);
        
DispatchKeyValue(prop"DefaultAnim""Idle_Yell_short");//Victory  Idle_Yell Idle_Yell_short
        
DispatchKeyValue(prop"fadescale""1");
        
DispatchKeyValue(prop"fademindist""1000");
        
DispatchKeyValue(prop"fademaxdist""1000");
        
        
DispatchSpawn(prop);
        
TeleportEntity(propTPosTAngNULL_VECTOR);
        
SetEntityRenderFx(propRENDERFX_FADE_FAST);
        
        
ActivateEntity(prop);
        
SetVariantString("!activator");
        
AcceptEntityInput(prop"SetParent"tank);
        
SetVariantString("!activator");
        
AcceptEntityInput(prop"SetAttached"tank);
        
        
tankGlowEnt[tank] = EntIndexToEntRef(prop);
        
TankTimer[tank] = CreateTimer(0.1TankAnimtankTIMER_REPEAT  TIMER_FLAG_NO_MAPCHANGE);
    }
}

public 
Action:TankAnim(Handle:timerany:tank)
{    
    if (
IsValidEntity(tank) && IsValidEntRef(tankGlowEnt[tank])) {
        
//decl Float:fPosePam[8], Float:fCycle;
        
decl Float:fPosePamFloat:fCycle;
        new 
SequenceAnimTime;

        
fCycle GetEntPropFloattankProp_Send"m_flCycle");//
        
Sequence GetEntProp(tankProp_Send"m_nSequence");//
        
AnimTime GetEntProptankProp_Send"m_flAnimTime"); //
        
        
SetEntPropFloat(tankGlowEnt[tank], Prop_Send"m_flCycle"fCycle);
        
SetEntProp(tankGlowEnt[tank], Prop_Send"m_nSequence"Sequence);
        
SetEntProp(tankGlowEnt[tank], Prop_Send"m_flAnimTime"AnimTime);
        
    }
    else 
    {
        if (
IsValidEntRef(tankGlowEnt[tank])){
            
AcceptEntityInput(tankGlowEnt[tank], "Kill");
            
tankGlowEnt[tank] = 0;
        }
        return 
Plugin_Stop;
    }
    
    return 
Plugin_Continue;

Attached Thumbnails
Click image for larger version

Name:	5.png
Views:	156
Size:	75.0 KB
ID:	178799   Click image for larger version

Name:	6.png
Views:	58
Size:	72.9 KB
ID:	178800   Click image for larger version

Name:	7.png
Views:	74
Size:	72.8 KB
ID:	178801  

Last edited by ttfak12; 12-18-2019 at 20:46.
ttfak12 is offline
Aya Supay
Member
Join Date: Nov 2015
Old 12-21-2019 , 20:32   Re: [L4D1] how to fix Tank glow
Reply With Quote #2

Quote:
Originally Posted by ttfak12 View Post
Hi everyone,
how to fix Tank glow

PHP Code:
public OnMapStart()
{
    
PrecacheModel("models/infected/hulk.mdl");
}

public 
Event_TankSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{    
    new 
TankID GetEventInt(event"tankid");
    
TankGlow(TankID);
}

TankGlow(tank)
{
    
decl Float:TPos[3], Float:TAng[3], String:TTeam[4];
    
GetEntPropVector(tankProp_Data"m_vecOrigin"TPos);
    
GetEntPropVector(tankProp_Send"m_angRotation"TAng);
    new 
prop CreateEntityByName("prop_glowing_object");
    
    if (
prop != 1) {
        
        
DispatchKeyValue(prop"model""models/infected/hulk.mdl");
        
DispatchKeyValue(prop"StartGlowing""1");
        
        
GetConVarString(hWGlowTeamTTeamsizeof(TTeam));
        
DispatchKeyValue(prop"GlowForTeam"TTeam);
        
DispatchKeyValue(prop"DefaultAnim""Idle_Yell_short");//Victory  Idle_Yell Idle_Yell_short
        
DispatchKeyValue(prop"fadescale""1");
        
DispatchKeyValue(prop"fademindist""1000");
        
DispatchKeyValue(prop"fademaxdist""1000");
        
        
DispatchSpawn(prop);
        
TeleportEntity(propTPosTAngNULL_VECTOR);
        
SetEntityRenderFx(propRENDERFX_FADE_FAST);
        
        
ActivateEntity(prop);
        
SetVariantString("!activator");
        
AcceptEntityInput(prop"SetParent"tank);
        
SetVariantString("!activator");
        
AcceptEntityInput(prop"SetAttached"tank);
        
        
tankGlowEnt[tank] = EntIndexToEntRef(prop);
        
TankTimer[tank] = CreateTimer(0.1TankAnimtankTIMER_REPEAT  TIMER_FLAG_NO_MAPCHANGE);
    }
}

public 
Action:TankAnim(Handle:timerany:tank)
{    
    if (
IsValidEntity(tank) && IsValidEntRef(tankGlowEnt[tank])) {
        
//decl Float:fPosePam[8], Float:fCycle;
        
decl Float:fPosePamFloat:fCycle;
        new 
SequenceAnimTime;

        
fCycle GetEntPropFloattankProp_Send"m_flCycle");//
        
Sequence GetEntProp(tankProp_Send"m_nSequence");//
        
AnimTime GetEntProptankProp_Send"m_flAnimTime"); //
        
        
SetEntPropFloat(tankGlowEnt[tank], Prop_Send"m_flCycle"fCycle);
        
SetEntProp(tankGlowEnt[tank], Prop_Send"m_nSequence"Sequence);
        
SetEntProp(tankGlowEnt[tank], Prop_Send"m_flAnimTime"AnimTime);
        
    }
    else 
    {
        if (
IsValidEntRef(tankGlowEnt[tank])){
            
AcceptEntityInput(tankGlowEnt[tank], "Kill");
            
tankGlowEnt[tank] = 0;
        }
        return 
Plugin_Stop;
    }
    
    return 
Plugin_Continue;


use SDKHook_PreThink
Aya Supay is offline
Reply



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 16:09.


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