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

[L4D2] Do not freeze survivors


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
phoenix0001
Senior Member
Join Date: Apr 2010
Location: China
Old 07-02-2018 , 23:37   [L4D2] Do not freeze survivors
Reply With Quote #1

Line 466 Freeze special infected and survivor in the radius.
Do not freeze survivors, only freeze infected people.
I don't know if it is ok?

PHP Code:
/******************************************************
*             L4D2: Satellite Cannon v1.3
*                    Author: ztar
*             Web: http://ztar.blog7.fc2.com/
*******************************************************/
#include <sourcemod>
#include <sdktools>
#define PLUGIN_VERSION "1.3"

#define MODE_JUDGEMENT    1
#define MODE_BLIZZARD    2
#define MODE_INFERNO    3
#define MODE_SLEEP        -1

#define OFF                0
#define ON                1
#define NORMAL            0
#define VARTICAL        1
#define SURVIVOR        2
#define INFECTED        3
#define MOLOTOV         0
#define EXPLODE         1

/* Message */
#define MESSAGE_EMPTY    "ENERGY IS RUNNING OUT"
#define MESSAGE_SHIFT    "MODE SHIFT COMPLETED"

/* Sound */
#define SOUND_NEGATIVE    "npc/soldier1/misc18.wav"
#define SOUND_SHOOT01    "npc/soldier1/misc17.wav"
#define SOUND_SHOOT02    "npc/soldier1/misc19.wav"
#define SOUND_SHOOT03    "npc/soldier1/misc20.wav"
#define SOUND_SHOOT04    "npc/soldier1/misc21.wav"
#define SOUND_SHOOT05    "npc/soldier1/misc22.wav"
#define SOUND_SHOOT06    "npc/soldier1/misc23.wav"
#define SOUND_SHOOT07    "npc/soldier1/misc08.wav"
#define SOUND_SHOOT08    "npc/soldier1/misc02.wav"
#define SOUND_SHOOT09    "npc/soldier1/misc07.wav"
#define SOUND_TRACING    "items/suitchargeok1.wav"
#define SOUND_IMPACT01    "animation/van_inside_hit_wall.wav"
#define SOUND_IMPACT02    "ambient/explosions/explode_3.wav"
#define SOUND_IMPACT03    "ambient/atmosphere/firewerks_burst_01.wav"
#define SOUND_FREEZE    "physics/glass/glass_pottery_break3.wav"
#define SOUND_DEFROST    "physics/glass/glass_sheet_break1.wav"

/* Model */
#define ENTITY_GASCAN    "models/props_junk/gascan001a.mdl"
#define ENTITY_PROPANE    "models/props_junk/propanecanister001a.mdl"

/* Sprite */
#define SPRITE_BEAM        "materials/sprites/laserbeam.vmt"
#define SPRITE_HALO        "materials/sprites/halo01.vmt"
#define SPRITE_GLOW        "materials/sprites/glow01.vmt"

/* Particle */
#define PARTICLE_FIRE01    "molotov_explosion"
#define PARTICLE_FIRE02    "molotov_explosion_child_burst"

/* Cvars */
new Handle:sm_satellite_enable            INVALID_HANDLE;
new 
Handle:sm_satellite_damage_01        INVALID_HANDLE;
new 
Handle:sm_satellite_freeze_02        INVALID_HANDLE;
new 
Handle:sm_satellite_damage_03        INVALID_HANDLE;
new 
Handle:sm_satellite_burst_delay        INVALID_HANDLE;
new 
Handle:sm_satellite_force            INVALID_HANDLE;
new 
Handle:sm_satellite_radius_01        INVALID_HANDLE;
new 
Handle:sm_satellite_radius_02        INVALID_HANDLE;
new 
Handle:sm_satellite_radius_03        INVALID_HANDLE;
new 
Handle:sm_satellite_limit_01        INVALID_HANDLE;
new 
Handle:sm_satellite_limit_02        INVALID_HANDLE;
new 
Handle:sm_satellite_limit_03        INVALID_HANDLE;
new 
Handle:sm_satellite_height            INVALID_HANDLE;
new 
Handle:sm_satellite_adminonly        INVALID_HANDLE;

/* Grobal */
new m_iClip1;
new 
hActiveWeapon;
new 
g_BeamSprite;
new 
g_HaloSprite;
new 
g_GlowSprite;
new 
tEntity;

new 
operation[MAXPLAYERS+1];
new 
ticket[MAXPLAYERS+1];
new 
raycount[MAXPLAYERS+1];
new 
freeze[MAXPLAYERS+1];
new 
energy[MAXPLAYERS+1][4];
new 
Float:trsPos[MAXPLAYERS+1][3];

public 
Plugin:myinfo 
{
    
name "[L4D2] Satellite Cannon",
    
author "ztar",
    
description "Three kind of vertical laser launches by shooting magnum.",
    
version PLUGIN_VERSION,
    
url "http://ztar.blog7.fc2.com/"
}

/******************************************************
*    When plugin started
*******************************************************/
public OnPluginStart()
{
    
sm_satellite_enable            CreateConVar("sm_satellite_enable","1","0:OFF 1:ON"FCVAR_NOTIFY);
    
sm_satellite_damage_01        CreateConVar("sm_satellite_damage_01","300.0""Damage of Satellite cannon (Mode:JUDGEMENT)"FCVAR_NOTIFY);
    
sm_satellite_freeze_02        CreateConVar("sm_satellite_freeze_02","5.0""Freeze time of Satellite cannon (Mode:BLIZZARD)"FCVAR_NOTIFY);
    
sm_satellite_damage_03        CreateConVar("sm_satellite_damage_03","420.0""Damage of Satellite cannon (Mode:INFERNO)"FCVAR_NOTIFY);
    
sm_satellite_burst_delay    CreateConVar("sm_satellite_burst_delay","1.0""Launching delay of Satellite cannon"FCVAR_NOTIFY);
    
sm_satellite_force            CreateConVar("sm_satellite_force","600.0""Push force of Satellite cannon"FCVAR_NOTIFY);
    
sm_satellite_radius_01        CreateConVar("sm_satellite_radius_01","300.0""Radius of Satellite cannon (Mode:JUDGEMENT)"FCVAR_NOTIFY);
    
sm_satellite_radius_02        CreateConVar("sm_satellite_radius_02","230.0""Radius of Satellite cannon (Mode:BLIZZARD)"FCVAR_NOTIFY);
    
sm_satellite_radius_03        CreateConVar("sm_satellite_radius_03","200.0""Radius of Satellite cannon (Mode:INFERNO)"FCVAR_NOTIFY);
    
sm_satellite_limit_01        CreateConVar("sm_satellite_limit_01","15""Frequency limitation in one round (Mode:JUDGEMENT)"FCVAR_NOTIFY);
    
sm_satellite_limit_02        CreateConVar("sm_satellite_limit_02","10""Frequency limitation in one round (Mode:BLIZZARD)"FCVAR_NOTIFY);
    
sm_satellite_limit_03        CreateConVar("sm_satellite_limit_03","10""Frequency limitation in one round (Mode:INFERNO)"FCVAR_NOTIFY);
    
sm_satellite_height            CreateConVar("sm_satellite_height","650""Height of launching point"FCVAR_NOTIFY);
    
sm_satellite_adminonly        CreateConVar("sm_satellite_adminonly","0""Admin only (0:OFF 1:ON 2:INFINITY)"FCVAR_NOTIFY);
    
    
HookEvent("weapon_fire"Event_Weapon_Fire);
    
HookEvent("item_pickup"Event_Item_Pickup);
    
HookEvent("round_start"Event_Round_Start);
    
    
hActiveWeapon FindSendPropOffs ("CTerrorPlayer""m_hActiveWeapon");
    
m_iClip1 FindSendPropInfo("CBaseCombatWeapon""m_iClip1");
    
    
AutoExecConfig(true,"l4d2_satellite");
}

/******************************************************
*    Initial functions
*******************************************************/
public OnMapStart()
{
    
ResetParameter();
    
    
/* Precache models */
    
PrecacheModel(ENTITY_PROPANEtrue);
    
PrecacheModel(ENTITY_GASCANtrue);
    
    
g_BeamSprite PrecacheModel(SPRITE_BEAM);
    
g_HaloSprite PrecacheModel(SPRITE_HALO);
    
g_GlowSprite PrecacheModel(SPRITE_GLOW);
    
PrecacheParticle(PARTICLE_FIRE01);
    
PrecacheParticle(PARTICLE_FIRE02);
    
    
/* Precache sounds */
    
PrecacheSound(SOUND_NEGATIVEtrue);
    
PrecacheSound(SOUND_SHOOT01true);
    
PrecacheSound(SOUND_SHOOT02true);
    
PrecacheSound(SOUND_SHOOT03true);
    
PrecacheSound(SOUND_SHOOT04true);
    
PrecacheSound(SOUND_SHOOT05true);
    
PrecacheSound(SOUND_SHOOT06true);
    
PrecacheSound(SOUND_SHOOT07true);
    
PrecacheSound(SOUND_SHOOT08true);
    
PrecacheSound(SOUND_SHOOT09true);
    
PrecacheSound(SOUND_TRACINGtrue);
    
PrecacheSound(SOUND_IMPACT01true);
    
PrecacheSound(SOUND_IMPACT02true);
    
PrecacheSound(SOUND_IMPACT03true);
    
PrecacheSound(SOUND_FREEZEtrue);
    
PrecacheSound(SOUND_DEFROSTtrue);
}

public 
Action:Event_Round_Start(Handle:event, const String:name[], bool:dontBroadcast)
{
    
ResetParameter();
}

public 
ResetParameter()
{
    for(new 
0MAXPLAYERS+1i++)
    {
        
energy[i][MODE_JUDGEMENT] = GetConVarInt(sm_satellite_limit_01);
        
energy[i][MODE_BLIZZARD] = GetConVarInt(sm_satellite_limit_02);
        
energy[i][MODE_INFERNO] = GetConVarInt(sm_satellite_limit_03);
    }
    for(new 
0MAXPLAYERS+1j++)
        
freeze[j] = OFF;
}

/******************************************************
*    Event when using magnum pistol
*******************************************************/    
public Action:Event_Weapon_Fire(Handle:event, const String:name[], bool:dontBroadcast)
{
    
decl String:mode[16];
    
GetConVarString(FindConVar("mp_gamemode"), modesizeof(mode));
    if(
StrEqual(mode"versus"))
        return;
    
    new 
attacker GetClientOfUserId(GetEventInt(event"userid"));
    
decl String:weapon[64];
    
GetEventString(event"weapon"weaponsizeof(weapon));
    
    
/* Admin only? */
    
if (GetUserAdmin(attacker) == INVALID_ADMIN_ID &&
        
GetConVarInt(sm_satellite_adminonly))
        return;
    
    if (
StrEqual(weapon"pistol_magnum") &&
        
GetConVarInt(sm_satellite_enable) && operation[attacker] > 0)
    {
        
/* Bot can't use */
        
if(GetClientTeam(attacker) != SURVIVOR || IsFakeClient(attacker))
            return;
        
        
/* Check energy */
        
if(energy[attacker][operation[attacker]] <= 0)
        {
            
PrintHintText(attackerMESSAGE_EMPTY);
            
operation[attacker] = MODE_SLEEP;
            return;
        }
        
        
/* Emit sound */
        
new soundNo GetRandomInt(19);
        if(
soundNo == 1)  EmitSoundToAll(SOUND_SHOOT01attacker);
        else if(
soundNo == 2)  EmitSoundToAll(SOUND_SHOOT02attacker);
        else if(
soundNo == 3)  EmitSoundToAll(SOUND_SHOOT03attacker);
        else if(
soundNo == 4)  EmitSoundToAll(SOUND_SHOOT04attacker);
        else if(
soundNo == 5)  EmitSoundToAll(SOUND_SHOOT05attacker);
        else if(
soundNo == 6)  EmitSoundToAll(SOUND_SHOOT06attacker);
        else if(
soundNo == 7)  EmitSoundToAll(SOUND_SHOOT07attacker);
        else if(
soundNo == 8)  EmitSoundToAll(SOUND_SHOOT08attacker);
        else if(
soundNo == 9)  EmitSoundToAll(SOUND_SHOOT09attacker);
        
        
/* Trace and show effect */
        
GetTracePosition(attacker);
        
EmitAmbientSound(SOUND_TRACINGtrsPos[attacker]);
        
CreateLaserEffect(attacker1501502302300.50.2NORMAL);
        
CreateSparkEffect(attacker12005);
        
        
/* Ready to launch */
        
CreateTimer(0.2TraceTimerattacker);
        
        
/* Reload compulsorily */
        
new wData GetEntDataEnt2(attackerhActiveWeapon);
        
SetEntData(wDatam_iClip10);
    }
}

public 
Action:Event_Item_Pickup(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    new 
String:item[64];
    
GetEventString(event"item"itemsizeof(item));
    
    if (
StrEqual(item"pistol_magnum") &&
        
GetConVarInt(sm_satellite_enable) &&
        
IsClientInGame(client) && !IsFakeClient(client))
    {
        
/* Display hint how to switch mode */
        
ClientCommand(client"gameinstructor_enable 1");
        
CreateTimer(0.3DisplayInstructorHintclient);
        
operation[client] = MODE_SLEEP;
    }
}

public 
Action:OnPlayerRunCmd(client, &buttons)
{
    if(
IsClientInGame(client) && IsPlayerAlive(client))
    {
        if(
GetClientTeam(client) != SURVIVOR)
            return;
        
        
/* Admin only? */
        
if (GetUserAdmin(client) == INVALID_ADMIN_ID &&
            
GetConVarInt(sm_satellite_adminonly))
            return;
        
        
/* If freezing, block mouse operation */
        
if(freeze[client] == ON)
        {
            if(
buttons IN_ATTACK)
                
buttons &= ~IN_ATTACK;
            if(
buttons IN_ATTACK2)
                
buttons &= ~IN_ATTACK2;
        }
        
        
/* When zoom key is pushed */
        
if(buttons IN_ZOOM)
        {
            
decl String:weapon[64];
            
GetClientWeapon(clientweapon64);
            
            if (
StrEqual(weapon"weapon_pistol_magnum") &&
                
GetConVarInt(sm_satellite_enable))
            {
                
/* Mode change menu */
                
ChangeMode(client);
            }
        }
    }
}

public 
ChangeMode(client)
{
    new 
String:mStrJud[64], String:mStrBli[64], String:mStrInf[64];
    
Format(mStrJudsizeof(mStrJud), "MODE: JUDGEMENT (Energy: %d)"energy[client][MODE_JUDGEMENT]);
    
Format(mStrBlisizeof(mStrBli), "MODE: BLIZZARD  (Energy: %d)"energy[client][MODE_BLIZZARD]);
    
Format(mStrInfsizeof(mStrInf), "MODE: INFERNO   (Energy: %d)"energy[client][MODE_INFERNO]);
    
    new 
Handle:menu CreateMenu(ChangeModeMenu);
    
SetMenuTitle(menu"*** Operation:Satellite System ***");
    
AddMenuItem(menu"0"mStrJud);
    
AddMenuItem(menu"1"mStrBli);
    
AddMenuItem(menu"2"mStrInf);
    
AddMenuItem(menu"3""SLEEP");
    
SetMenuExitButton(menutrue);
    
DisplayMenu(menuclient10);
}

public 
ChangeModeMenu(Handle:menuMenuAction:actionclientitemNum)
{
    if(
action == MenuAction_Select)
    {
        switch(
itemNum)
        {
            case 
0:
                
operation[client] = MODE_JUDGEMENT;
            case 
1:
                
operation[client] = MODE_BLIZZARD;
            case 
2:
                
operation[client] = MODE_INFERNO;
            case 
3:
                
operation[client] = MODE_SLEEP;
        }
        if(
itemNum != && energy[client][itemNum+1] <= 0)
        {
            
PrintHintText(clientMESSAGE_EMPTY);
            
EmitSoundToClient(clientSOUND_NEGATIVE);
            
operation[client] = MODE_SLEEP;
        }
        else
        {
            
PrintHintText(clientMESSAGE_SHIFT);
            
EmitSoundToClient(clientSOUND_SHOOT02);
        }
    }
}

/******************************************************
*    Timer functions about launching
*******************************************************/
public Action:TraceTimer(Handle:timerany:client)
{
    
/* Ring laser effect */
    
CreateRingEffect(client1501502302302.0,
                
GetConVarFloat(sm_satellite_burst_delay));
    
    
/* Launch satellite cannon */
    
raycount[client] = 0;
    
ticket[client] = 0;
    
    
/* If ducking, three laser launched */
    
if( (GetEntityFlags(client) & FL_DUCKING) &&
        (
GetEntityFlags(client) & FL_ONGROUND))
        
ticket[client] = 1;
    
    
CreateTimer(GetConVarFloat(sm_satellite_burst_delay),
                
SatelliteTimerclient);
}

public 
Action:SatelliteTimer(Handle:timerany:client)
{
    if(!
IsValidEntity(client) || !IsClientInGame(client) || !IsPlayerAlive(client))
        return;
    
    if (
operation[client] != MODE_JUDGEMENT &&
        
operation[client] != MODE_BLIZZARD &&
        
operation[client] != MODE_INFERNO)
            
operation[client] = MODE_JUDGEMENT;
    
    
/* Mode: JUDGEMENT */
    
if(operation[client] == MODE_JUDGEMENT)
    {
        
Judgement(client);
        if(
raycount[client] == && GetConVarInt(sm_satellite_adminonly) != 2)
            
energy[client][MODE_JUDGEMENT]--;
    }
    
    
/* Mode: BLIZZARD */
    
else if(operation[client] == MODE_BLIZZARD)
    {
        
Blizzard(client);
        if(
GetConVarInt(sm_satellite_adminonly) != 2)
            
energy[client][MODE_BLIZZARD]--;
        
    }
    
    
/* Mode: INFERNO */
    
else if(operation[client] == MODE_INFERNO)
    {
        
Inferno(client);
        if(
GetConVarInt(sm_satellite_adminonly) != 2)
            
energy[client][MODE_INFERNO]--;
    }
    
    
/* If energy becomes empty, display message */
    
if(energy[client][operation[client]] <= 0)
    {
        
PrintHintText(clientMESSAGE_EMPTY);
        
operation[client] = MODE_SLEEP;
    }
}

public 
Judgement(client)
{
    
decl Float:pos[3];
    
    
/* Emit impact sound */
    
EmitAmbientSound(SOUND_IMPACT01trsPos[client]);
    
    
/* Laser effect */
    
CreateLaserEffect(client230230802306.01.0VARTICAL);
    
    
/* Damage to special infected */
    
for(new 1<= GetMaxClients(); i++)
    {
        if(!
IsClientInGame(i) || GetClientTeam(i) != 3)
            continue;
        
GetClientAbsOrigin(ipos);
        if(
GetVectorDistance(postrsPos[client]) < GetConVarFloat(sm_satellite_radius_01))
        {
            
DamageEffect(iGetConVarFloat(sm_satellite_damage_01));
        }
    }
    
/* Explode */
    
LittleFlower(clientEXPLODE);
    
    
/* Push away */
    
PushAway(clientGetConVarFloat(sm_satellite_force),
            
GetConVarFloat(sm_satellite_radius_01), 0.5);
    
    if(
ticket[client] == 1)
    {
        
raycount[client]++;
        if(
raycount[client] >= 3)
        {
            
ticket[client] = 0;
            
raycount[client] = 0;
            return;
        }
        
/* Set random offset position */
        
MoveTracePosition(client50150);
        
CreateTimer(0.17SatelliteTimerclient);
    }
}

public 
Blizzard(client)
{
    
decl Float:pos[3];
    
    
/* Emit impact sound */
    
EmitAmbientSound(SOUND_IMPACT01trsPos[client]);
    
EmitAmbientSound(SOUND_IMPACT02trsPos[client]);
    
    
/* Laser effect */
    
CreateLaserEffect(client80802302306.01.0VARTICAL);
    
TE_SetupBeamRingPoint(trsPos[client], 10.0GetConVarFloat(sm_satellite_radius_02),
                        
g_BeamSpriteg_HaloSprite0100.310.00.5,
                        {
4040230230}, 4000);
    
TE_SendToAll();
    
    
/* Freeze special infected and survivor in the radius */
    
for(new 1<= GetMaxClients(); i++)
    {
        if(!
IsClientInGame(i))
            continue;
        
GetClientEyePosition(ipos);
        if(
GetVectorDistance(postrsPos[client]) < GetConVarFloat(sm_satellite_radius_02))
        {
            if(
GetEntProp(iProp_Send"m_zombieClass") != 8)
                
FreezePlayer(iposGetConVarFloat(sm_satellite_freeze_02));
        }
    }
    
    
/* Freeze infected in the radius */
    
decl MaxEntitiesString:mName[64], Float:entPos[3];
    
    
MaxEntities GetMaxEntities();
    for (new 
1<= MaxEntitiesi++)
    {
        if (
IsValidEdict(i) && IsValidEntity(i))
        {
            
GetEntPropString(iProp_Data"m_ModelName"mNamesizeof(mName))
            if (
StrContains(mName"infected") != -1)
            {
                
GetEntPropVector(iProp_Send"m_vecOrigin"entPos)
                if (
GetVectorDistance(trsPos[client], entPos) < GetConVarFloat(sm_satellite_radius_02))
                {
                    
EmitAmbientSound(SOUND_FREEZEentPosiSNDLEVEL_RAIDSIREN);
                    
TE_SetupGlowSprite(entPosg_GlowSprite5.03.0130);
                    
TE_SendToAll();
                    
DamageEffect(i100.0);
                }
            }
        }
    }
    
/* Push away */
    
PushAway(clientGetConVarFloat(sm_satellite_force),
            
GetConVarFloat(sm_satellite_radius_02), 0.5);
}

public 
Inferno(client)
{
    
decl Float:pos[3];
    
    
/* Emit impact sound */
    
EmitAmbientSound(SOUND_IMPACT01trsPos[client]);
    
EmitAmbientSound(SOUND_IMPACT03trsPos[client]);
    
    
/* Laser effect */
    
CreateLaserEffect(client23040402306.01.0VARTICAL);
    
ShowParticle(trsPos[client], PARTICLE_FIRE013.0);
    
ShowParticle(trsPos[client], PARTICLE_FIRE023.0);
    
    
/* Ignite special infected and survivor in the radius */
    
for(new 1<= GetMaxClients(); i++)
    {
        if(!
IsClientInGame(i))
            continue;
        
GetClientEyePosition(ipos);
        if(
GetVectorDistance(postrsPos[client]) < GetConVarFloat(sm_satellite_radius_03))
        {
            if(
GetClientTeam(i) == SURVIVOR)
            {
                
ScreenFade(i20000150801);
                
DamageEffect(i5.0);
            }
            else if(
GetClientTeam(i) == INFECTED)
            {
                
IgniteEntity(i10.0);
                
DamageEffect(iGetConVarFloat(sm_satellite_damage_03));
            }
        }
    }
    
    
/* Ignite infected in the radius */
    
decl MaxEntitiesString:mName[64], Float:entPos[3];
    
    
MaxEntities GetMaxEntities();
    for (new 
1<= MaxEntitiesi++)
    {
        if (
IsValidEdict(i) && IsValidEntity(i))
        {
            
GetEntPropString(iProp_Data"m_ModelName"mNamesizeof(mName))
            if (
StrContains(mName"infected") != -1)
            {
                
GetEntPropVector(iProp_Send"m_vecOrigin"entPos)
                
entPos[2] += 50;
                if (
GetVectorDistance(trsPos[client], entPos) < GetConVarFloat(sm_satellite_radius_03))
                {
                    
IgniteEntity(i10.0);
                }
            }
        }
    }
    
/* Push away */
    
PushAway(clientGetConVarFloat(sm_satellite_force),
            
GetConVarFloat(sm_satellite_radius_03), 0.5);
}

public 
Action:DefrostPlayer(Handle:timerany:entity)
{
    if(
IsValidEdict(entity) && IsValidEntity(entity))
    {
        
decl Float:entPos[3];
        
GetEntPropVector(entityProp_Send"m_vecOrigin"entPos);
        
EmitAmbientSound(SOUND_DEFROSTentPosentitySNDLEVEL_RAIDSIREN);
        
SetEntityMoveType(entityMOVETYPE_WALK);
        
SetEntityRenderColor(entity255255255255);
        
ScreenFade(entity000001);
        
freeze[entity] = OFF;
    }
}

public 
Action:DeletePushForce(Handle:timerany:ent)
{
    if (
IsValidEntity(ent))
    {
        
decl String:classname[64];
        
GetEdictClassname(entclassnamesizeof(classname));
        if (
StrEqual(classname"point_push"false))
        {
            
AcceptEntityInput(ent"Disable");
            
AcceptEntityInput(ent"Kill"); 
            
RemoveEdict(ent);
        }
    }
}

/******************************************************
*    TE functions
*******************************************************/
public GetTracePosition(client)
{
    
decl Float:myPos[3], Float:myAng[3], Float:tmpPos[3], Float:entPos[3];
    
    
GetClientEyePosition(clientmyPos);
    
GetClientEyeAngles(clientmyAng);
    new 
Handle:trace TR_TraceRayFilterEx(myPosmyAngCONTENTS_SOLID|CONTENTS_MOVEABLERayType_InfiniteTraceEntityFilterPlayerclient);
    if(
TR_DidHit(trace))
    {
        
tEntity TR_GetEntityIndex(trace);
        
GetEntPropVector(tEntityProp_Send"m_vecOrigin"entPos);
        
TR_GetEndPosition(tmpPostrace);
    }
    
CloseHandle(trace);
    for(new 
03i++)
        
trsPos[client][i] = tmpPos[i];
}

public 
MoveTracePosition(clientminmax)
{
    new 
point GetRandomInt(14);
    new 
xOffset GetRandomInt(minmax);
    new 
yOffset GetRandomInt(minmax);
    
    if(
point == 1)
    {
        
trsPos[client][0] -= xOffset;
        
trsPos[client][1] += yOffset;
    }
    else if(
point == 2)
    {
        
trsPos[client][0] += xOffset;
        
trsPos[client][1] += yOffset;
    }
    else if(
point == 3)
    {
        
trsPos[client][0] -= xOffset;
        
trsPos[client][1] -= yOffset;
    }
    else if(
point == 4)
    {
        
trsPos[client][0] += xOffset;
        
trsPos[client][1] -= yOffset;
    }
}

public 
bool:TraceEntityFilterPlayer(entitycontentsMask)
{
    return 
entity GetMaxClients() || !entity;
}

public 
CreateLaserEffect(clientcolRedcolGrecolBlualphaFloat:widthFloat:durationmode)
{
    
decl color[4];
    
color[0] = colRed;
    
color[1] = colGre;
    
color[2] = colBlu;
    
color[3] = alpha;
    
    if(
mode == NORMAL)
    {
        
/* Show laser between user and impact position */
        
decl Float:myPos[3];
        
        
GetClientEyePosition(clientmyPos);
        
TE_SetupBeamPoints(myPostrsPos[client], g_BeamSprite000,
                            
durationwidthwidth10.0color0);
        
TE_SendToAll();
    }
    else if(
mode == VARTICAL)
    {
        
/* Show laser like lightning bolt */
        
decl Float:lchPos[3];
        
        for(new 
03i++)
            
lchPos[i] = trsPos[client][i];
        
lchPos[2] += GetConVarInt(sm_satellite_height);
        
TE_SetupBeamPoints(lchPostrsPos[client], g_BeamSprite000,
                            
durationwidthwidth12.0color0);
        
TE_SendToAll();
        
TE_SetupGlowSprite(lchPosg_GlowSprite1.52.8230);
        
TE_SendToAll();
    }
}

public 
CreateRingEffect(clientcolRedcolGrecolBlualphaFloat:widthFloat:duration)
{
    
decl color[4];
    
color[0] = colRed;
    
color[1] = colGre;
    
color[2] = colBlu;
    
color[3] = alpha;
    
    
TE_SetupBeamRingPoint(trsPos[client], 300.010.0g_BeamSprite,
                        
g_HaloSprite0101.24.00.5,
                        {
150150230230}, 800);
    
TE_SendToAll();
}

public 
CreateSparkEffect(clientsizelength)
{
    
decl Float:spkVec[3];
    
spkVec[0]=GetRandomFloat(-1.01.0);
    
spkVec[1]=GetRandomFloat(-1.01.0);
    
spkVec[2]=GetRandomFloat(-1.01.0);
    
    
TE_SetupSparks(trsPos[client], spkVecsizelength);
    
TE_SendToAll();
}

/******************************************************
*    Other functions
*******************************************************/
stock DamageEffect(targetFloat:damage)
{
    
decl String:tName[20];
    
Format(tName20"target%d"target);
    new 
pointHurt CreateEntityByName("point_hurt");
    
DispatchKeyValue(target"targetname"tName);
    
DispatchKeyValueFloat(pointHurt"Damage"damage);
    
DispatchKeyValue(pointHurt"DamageTarget"tName);
    
DispatchKeyValue(pointHurt"DamageType""65536");
    
DispatchSpawn(pointHurt);
    
AcceptEntityInput(pointHurt"Hurt");
    
AcceptEntityInput(pointHurt"Kill");
}

public 
PushAway(clientFloat:forceFloat:radiusFloat:duration)
{
    new 
push CreateEntityByName("point_push");
    
DispatchKeyValueFloat (push"magnitude"force);
    
DispatchKeyValueFloat (push"radius"radius);
    
SetVariantString("spawnflags 24");
    
AcceptEntityInput(push"AddOutput");
    
DispatchSpawn(push);
    
TeleportEntity(pushtrsPos[client], NULL_VECTORNULL_VECTOR);
    
AcceptEntityInput(push"Enable", -1, -1);
    
CreateTimer(durationDeletePushForcepush);
}

public 
LittleFlower(clienttype)
{
    
/* Cause fire(type=0) or explosion(type=1) */
    
new entity CreateEntityByName("prop_physics");
    if (
IsValidEntity(entity))
    {
        
trsPos[client][2] += 20;
        if (
type == 0)
            
/* fire */
            
DispatchKeyValue(entity"model"ENTITY_GASCAN);
        else
            
/* explode */
            
DispatchKeyValue(entity"model"ENTITY_PROPANE);
        
DispatchSpawn(entity);
        
SetEntData(entityGetEntSendPropOffs(entity"m_CollisionGroup"), 11true);
        
TeleportEntity(entitytrsPos[client], NULL_VECTORNULL_VECTOR);
        
AcceptEntityInput(entity"break");
    }
}

public 
ScreenFade(targetredgreenbluealphadurationtype)
{
    new 
Handle:msg StartMessageOne("Fade"target);
    
BfWriteShort(msg500);
    
BfWriteShort(msgduration);
    if (
type == 0)
        
BfWriteShort(msg, (0x0002 0x0008));
    else
        
BfWriteShort(msg, (0x0001 0x0010));
    
BfWriteByte(msgred);
    
BfWriteByte(msggreen);
    
BfWriteByte(msgblue);
    
BfWriteByte(msgalpha);
    
EndMessage();
}

public 
FreezePlayer(entityFloat:pos[3], Float:time)
{
    
SetEntityMoveType(entityMOVETYPE_NONE);
    
SetEntityRenderColor(entity0128255135);
    
ScreenFade(entity012825519220001);
    
EmitAmbientSound(SOUND_FREEZEposentitySNDLEVEL_RAIDSIREN);
    
TE_SetupGlowSprite(posg_GlowSpritetime0.5130);
    
TE_SendToAll();
    
freeze[entity] = ON;
    
CreateTimer(timeDefrostPlayerentity);
}

/******************************************************
*    Particle control functions
*******************************************************/
public ShowParticle(Float:pos[3], String:particlename[], Float:time)
{
    
/* Show particle effect you like */
    
new particle CreateEntityByName("info_particle_system");
    if (
IsValidEdict(particle))
    {
        
TeleportEntity(particleposNULL_VECTORNULL_VECTOR);
        
DispatchKeyValue(particle"effect_name"particlename);
        
DispatchKeyValue(particle"targetname""particle");
        
DispatchSpawn(particle);
        
ActivateEntity(particle);
        
AcceptEntityInput(particle"start");
        
CreateTimer(timeDeleteParticlesparticle);
    }  
}

public 
Action:DeleteParticles(Handle:timerany:particle)
{
    
/* Delete particle */
    
if (IsValidEntity(particle))
    {
        new 
String:classname[64];
        
GetEdictClassname(particleclassnamesizeof(classname));
        if (
StrEqual(classname"info_particle_system"false))
            
RemoveEdict(particle);
    }
}

public 
PrecacheParticle(String:particlename[])
{
    
/* Precache particle */
    
new particle CreateEntityByName("info_particle_system");
    if (
IsValidEdict(particle))
    {
        
DispatchKeyValue(particle"effect_name"particlename);
        
DispatchKeyValue(particle"targetname""particle");
        
DispatchSpawn(particle);
        
ActivateEntity(particle);
        
AcceptEntityInput(particle"start");
        
CreateTimer(0.01DeleteParticlesparticle);
    }  
}

/******************************************************
*    Display hint functions
*******************************************************/
public Action:DisplayInstructorHint(Handle:timerany:client)
{
    
decl entityString:tName[32], Handle:hRemovePack;
    
    
entity CreateEntityByName("env_instructor_hint");
    
FormatEx(tNamesizeof(tName), "hint%d"client);
    
    
DispatchKeyValue(client"targetname"tName);
    
DispatchKeyValue(entity"hint_target"tName);
    
DispatchKeyValue(entity"hint_timeout""5");
    
DispatchKeyValue(entity"hint_range""0.01");
    
DispatchKeyValue(entity"hint_color""255 255 255");
    
DispatchKeyValue(entity"hint_icon_onscreen""use_binding");
    
DispatchKeyValue(entity"hint_caption""Change mode");
    
DispatchKeyValue(entity"hint_binding""+zoom");
    
DispatchSpawn(entity);
    
AcceptEntityInput(entity"ShowHint");
    
    
hRemovePack CreateDataPack();
    
WritePackCell(hRemovePackclient);
    
WritePackCell(hRemovePackentity);
    
CreateTimer(5.0RemoveInstructorHinthRemovePack);
}
    
public 
Action:RemoveInstructorHint(Handle:timerHandle:hPack)
{
    
decl entityclient
    
    ResetPack
(hPackfalse)
    
client ReadPackCell(hPack)
    
entity ReadPackCell(hPack)
    
CloseHandle(hPack)
    
    if (!
client || !IsClientInGame(client))
        return;
    
    if (
IsValidEntity(entity))
            
RemoveEdict(entity)
    
    
ClientCommand(client"gameinstructor_enable 0")
    
DispatchKeyValue(client"targetname""")
}

/******************************************************
*    EOF
*******************************************************/ 
__________________
I like this BBS sharing of spirit

I come from China, my English is poor
phoenix0001 is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 07-03-2018 , 02:34   Re: [L4D2] Do not freeze survivors
Reply With Quote #2

Replace line 460 with this:
Code:
        if(!IsClientInGame(i) || GetClientTeam(i) != 3)
Drixevel is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 07-03-2018 , 03:30   Re: [L4D2] Do not freeze survivors
Reply With Quote #3

Quote:
Originally Posted by Drixevel View Post
Replace line 460 with this:
Code:
        if(!IsClientInGame(i) || GetClientTeam(i) != 3)
460 is CreateLaserEffect(client, 80, 80, 230, 230, 6.0, 1.0, VARTICAL);


PHP Code:
    /* Freeze special infected and survivor in the radius */
    
for(new 1<= GetMaxClients(); i++)
    {
        if(!
IsClientInGame(i))
            continue; 
>>

PHP Code:
    /* Freeze special infected and survivor in the radius */
    
for(new 1<= MaxClientsi++)
    {
        if(!
IsClientInGame(i) && GetClientTeam(i) != 3)
            continue; 
__________________
Silvers is offline
phoenix0001
Senior Member
Join Date: Apr 2010
Location: China
Old 07-03-2018 , 06:16   Re: [L4D2] Do not freeze survivors
Reply With Quote #4

Thank you all.
__________________
I like this BBS sharing of spirit

I come from China, my English is poor
phoenix0001 is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 07-03-2018 , 06:41   Re: [L4D2] Do not freeze survivors
Reply With Quote #5

Quote:
Originally Posted by Drixevel View Post
Replace line 460 with this:
Code:
        if(!IsClientInGame(i) || GetClientTeam(i) != 3)
+1
cravenge is offline
phoenix0001
Senior Member
Join Date: Apr 2010
Location: China
Old 08-19-2018 , 13:09   Re: [L4D2] Do not freeze survivors
Reply With Quote #6

There is a new problem now.

Observers and infected people in the state of the soul, they will be frozen.
How to keep them from being frozen?
__________________
I like this BBS sharing of spirit

I come from China, my English is poor
phoenix0001 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 05:43.


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