User-Profile-Image
hankin
  • 5
  • 关于
  • 分类
    • 路由器
    • 电脑相关
    • 游戏相关
    • 未分类
    • 服务器相关
    • 数据库
  • 页面
    • 关于
  • 友链
    • 华夏网盟
Help?

Please contact us on our email for need any support

Support
  • 关于
    首页   ›   游戏相关   ›   正文
游戏相关

求生之路 飞檐走壁-源码

2021-02-23 08:52:00
113  0 0
也可以说是飞檐走壁的吧,按shift 然后跳



#pragma semicolon 1
#include <sourcemod>
#include <sdktools>

#define PLUGIN_VERSION "1.0.7"
#define SOUND_LANDING  "player/jumplanding.wav"
#define SOUND_LANDING2  "player/PZ/fall/Bodyfall_LargeCreature.wav"


 new bool:JumpEnabled[MAXPLAYERS+1];
 new KeyBuffer[MAXPLAYERS+1];
 new FlagBuffer[MAXPLAYERS+1];
 new OnAir[MAXPLAYERS+1];
 new MovementState[MAXPLAYERS+1];
 new ReadyButton[MAXPLAYERS+1];
 new Float:FallVol[MAXPLAYERS+1];
 new Float:InpcapJumpTime[MAXPLAYERS+1];

new Handle:timer_handle=INVALID_HANDLE;
new Handle:l4d_fyzb_showtime = INVALID_HANDLE;
new Handle:l4d_fyzb_enabled = INVALID_HANDLE;
new Handle:l4d_fyzb_init = INVALID_HANDLE;
new Handle:l4d_fyzb_damage = INVALID_HANDLE;
new Handle:l4d_fyzb_damage2 = INVALID_HANDLE;
new Handle:l4d_fyzb_distancediff = INVALID_HANDLE;
new Handle:l4d_fyzb_anglediff1 = INVALID_HANDLE;
new Handle:l4d_fyzb_anglediff2 = INVALID_HANDLE;
new Handle:l4d_fyzb_speed = INVALID_HANDLE;
new Handle:l4d_fyzb_speed_incap = INVALID_HANDLE;
new Handle:l4d_fyzb_velocitydiff = INVALID_HANDLE;
new Handle:l4d_fyzb_movement = INVALID_HANDLE;
new Handle:l4d_fyzb_safegravity = INVALID_HANDLE;
new Handle:l4d_fyzb_safefallspeed = INVALID_HANDLE;
new Handle:l4d_fyzb_callboss = INVALID_HANDLE;
new Handle:l4d_fyzb_edgerealese = INVALID_HANDLE;
new Handle:l4d_fyzb_tankuse = INVALID_HANDLE;
new Handle:l4d_fyzb_infecteduse = INVALID_HANDLE;
new Handle:l4d_fyzb_god = INVALID_HANDLE;

new all_iVelocity;
new String:sdemage[10];
new String:sdemage2[10];
new Float:speed;
new Float:speed_incap;
new damage;
new damage2;
new Float:distancediff;
new Float:anglediff1;
new Float:anglediff2;
new Float:velocitydiff;
new Float:movement;
new Float:safegravity;
new Float:safefallspeed;
new callboss;
new edgerealese;
new infecteduse;
new godmode;
new Enabled;

public Plugin:myinfo =
{
 name = "飞檐走壁",
 author = "小海",
 description = "飞檐走壁",
 version = PLUGIN_VERSION,
}

public OnPluginStart()
{
 CreateConVar("l4d_fyzb_version", PLUGIN_VERSION, "1.07 ", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_NOTIFY|FCVAR_DONTRECORD);
 l4d_fyzb_enabled = CreateConVar("l4d_fyzb_enabled", "1", " 1 : 启动飞檐走壁 , 0: 禁用飞檐走壁 ", FCVAR_PLUGIN);
 l4d_fyzb_init = CreateConVar("l4d_fyzb_init", "0", " 1 : 初始启动 , 0: 初始禁用 ", FCVAR_PLUGIN);
 l4d_fyzb_speed = CreateConVar("l4d_fyzb_speed", "650.0", "跳跃速度", FCVAR_PLUGIN);
 l4d_fyzb_speed_incap = CreateConVar("l4d_fyzb_speed_incap", "300.0", "倒下跳跃速度", FCVAR_PLUGIN);
 l4d_fyzb_distancediff = CreateConVar("l4d_fyzb_distancediff", "60.0", "距离难度,越小越难 必须>0", FCVAR_PLUGIN);
 l4d_fyzb_anglediff1 = CreateConVar("l4d_fyzb_anglediff1", "9.0", "背跳难度,越小越难 必须>=0", FCVAR_PLUGIN);
 l4d_fyzb_anglediff2 = CreateConVar("l4d_fyzb_anglediff2", "0.0", "墙跳难度,越小越难 必须>=0  无用 必须为0", FCVAR_PLUGIN);
 l4d_fyzb_velocitydiff = CreateConVar("l4d_fyzb_velocitydiff", "0.0", "速度难度,越小越难 必须>=0 无用 必须为0", FCVAR_PLUGIN);
  l4d_fyzb_damage = CreateConVar("l4d_fyzb_damage", "5", "伤害", FCVAR_PLUGIN);
  l4d_fyzb_damage2 = CreateConVar("l4d_fyzb_damage2", "50", "感染者伤害", FCVAR_PLUGIN);
  l4d_fyzb_movement = CreateConVar("l4d_fyzb_movement", "0.90", "慢动作系数 [0.5-1.0]", FCVAR_PLUGIN);
  l4d_fyzb_safegravity = CreateConVar("l4d_fyzb_safegravity", "0.6", "重力系数, 安全选项,越小越安全 [0.3-1.0]", FCVAR_PLUGIN);
  l4d_fyzb_safefallspeed = CreateConVar("l4d_fyzb_safefallspeed", "10", "下降速度阀值, 安全选项,越小越安全 [10-1000]", FCVAR_PLUGIN);
  l4d_fyzb_callboss = CreateConVar("l4d_fyzb_callboss", "7", "使用招怪物概率 %", FCVAR_PLUGIN);
  l4d_fyzb_edgerealese = CreateConVar("l4d_fyzb_edgerealese", "1", "挂边掉下 无用", FCVAR_PLUGIN);
 l4d_fyzb_showtime = CreateConVar("l4d_fyzb_showtime", "80", "提示间隔", FCVAR_PLUGIN);
   l4d_fyzb_infecteduse = CreateConVar("l4d_fyzb_infecteduse", "2", "0 , 禁用, 1,使用, 2, 除tank之外使用", FCVAR_PLUGIN);
   l4d_fyzb_god = CreateConVar("l4d_fyzb_god", "1", "0 , 禁用, 1,使用, 不摔死模式", FCVAR_PLUGIN);

 AutoExecConfig(true, "l4d_fyzb_v17");

 HookConVarChange(l4d_fyzb_enabled, ConVarChange);
 HookConVarChange(l4d_fyzb_speed, ConVarChange);
 HookConVarChange(l4d_fyzb_speed_incap, ConVarChange);
  HookConVarChange(l4d_fyzb_damage, ConVarChange);
 HookConVarChange(l4d_fyzb_distancediff, ConVarChange);
 HookConVarChange(l4d_fyzb_velocitydiff, ConVarChange);
 HookConVarChange(l4d_fyzb_anglediff1, ConVarChange);
 HookConVarChange(l4d_fyzb_anglediff2, ConVarChange);
 HookConVarChange(l4d_fyzb_movement, ConVarChange);
 HookConVarChange(l4d_fyzb_safefallspeed, ConVarChange);
 HookConVarChange(l4d_fyzb_safegravity, ConVarChange);
 HookConVarChange(l4d_fyzb_callboss, ConVarChange);
 HookConVarChange(l4d_fyzb_edgerealese, ConVarChange);
  HookConVarChange(l4d_fyzb_infecteduse, ConVarChange);
   HookConVarChange(l4d_fyzb_god, ConVarChange);

 GetConVar();

   all_iVelocity = FindSendPropOffs("CBasePlayer", "m_vecVelocity[0]");

 HookEvent("round_end", RoundEnd);
 HookEvent("mission_lost", RoundEnd);
 HookEvent("finale_win", RoundEnd);
 HookEvent("round_start", RoundStart);
    HookEvent("player_spawn", evtPlayerSpawn);
  RegConsoleCmd("sm_fyzb", Command_QG);
  RegConsoleCmd("sm_fyzb2", Command_QG2);
  Reset();
}
public OnMapStart()
{
 PrecacheSound(SOUND_LANDING, true) ;
 PrecacheSound(SOUND_LANDING2, true) ;
}
public ConVarChange(Handle:convar, const String:oldValue[], const String:newValue[])
{
 GetConVar();

}
GetConVar()
{
 damage=GetConVarInt(l4d_fyzb_damage );
  Format(sdemage, sizeof(sdemage),  "%i", damage);
 damage2=GetConVarInt(l4d_fyzb_damage2 );
  Format(sdemage2, sizeof(sdemage2),  "%i", damage2);
 speed=GetConVarFloat(l4d_fyzb_speed );
 speed_incap=GetConVarFloat(l4d_fyzb_speed_incap );
  damage=GetConVarInt(l4d_fyzb_damage );
 Enabled=GetConVarInt(l4d_fyzb_enabled) ;
 callboss=GetConVarInt(l4d_fyzb_callboss) ;
 edgerealese=GetConVarInt(l4d_fyzb_edgerealese) ;
 distancediff=GetConVarFloat(l4d_fyzb_distancediff);
 anglediff1=GetConVarFloat(l4d_fyzb_anglediff1);
 anglediff2=GetConVarFloat(l4d_fyzb_anglediff2);
 velocitydiff=GetConVarFloat(l4d_fyzb_velocitydiff);
 movement=GetConVarFloat(l4d_fyzb_movement);
 safefallspeed=GetConVarFloat(l4d_fyzb_safefallspeed);
 safegravity=GetConVarFloat(l4d_fyzb_safegravity);
  infecteduse=GetConVarInt(l4d_fyzb_infecteduse) ;
  godmode=GetConVarInt(l4d_fyzb_god) ;
}
 public Action:evtPlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
  new client = GetClientOfUserId(GetEventInt(event, "userid"));
 if(client<=0)return;
 //if(IsClientInGame(client) && IsPlayerAlive(client))
 {
  SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue",  1.0);
  SetEntityGravity(client,1.0);
  SetEntProp(client, Prop_Data, "m_takedamage", 2, 1);
  OnAir[client]=0;
   MovementState[client]=0;

 }

}
public Action:Command_sea(client, args)
{
  PrintToChatAll("飞檐走壁插件 小海");
 return Plugin_Handled;
}
public Action:Msg(Handle:timer, any:data)
{
 PrintToChatAll("\x01[sea]\x03输入: \x04!fyzb 或 !fyzb2\x03可以学会飞檐走壁");
   return Plugin_Continue;
}
public Action:Command_QG(client, args)
{
 if (client == 0 || !IsClientInGame(client))
  return Plugin_Handled;
 JumpEnabled[client]=!JumpEnabled[client];
 ReadyButton[client]=IN_SPEED;
 if( JumpEnabled[client])
 {
  PrintToChat(client, "\x01[sea]\x03你练成飞檐走壁,使用方法:\x04按住走路键(默认shift),然后跳,\x03不要过多使用,否则会引来感染者.");

 }
 else
 {
  PrintToChat(client, "\x01[sea]\x03你废除了飞檐走壁");
  //SetEntityGravity(client,1.0);
  //SetEntProp(client, Prop_Data, "m_takedamage", 2, 1);
  //SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue",  1.0);
 }

   return Plugin_Handled;
}
public Action:Command_QG2(client, args)
{
 if (client == 0 || !IsClientInGame(client))
  return Plugin_Handled;
 JumpEnabled[client]=!JumpEnabled[client];
 ReadyButton[client]=IN_DUCK;
 if( JumpEnabled[client])
 {
  PrintToChat(client, "\x01[sea]\x03你练成飞檐走壁,使用方法:\x04按住蹲下键,然后跳,\x03不要过多使用,否则会引来感染者.");
 }
 else
 {
  PrintToChat(client, "\x01[sea]\x03你废除了飞檐走壁");
  //SetEntityGravity(client,1.0);
  //SetEntProp(client, Prop_Data, "m_takedamage", 2, 1);
  //SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue",  1.0);
 }

   return Plugin_Handled;
}

new String:buff[100];
new oldflag;
new Float:velocity[3];
new Float:vel;
new Float:clientpos[3];
new Float:clientangle[3];
new Float:reserveclientangle[3];
new Float:reserveclientangle2[3];
new Float:angledir[3];
new Float:clientdirection[3];
new Float:hitpos[3];
new Key=IN_SPEED;
new bool:allow=false;
new bool:ground=false;
new bool:hold=false;
new bool:incap;
new buttons;
new flag;
new Float:dis;
new Handle:trace;
new random;
new Float:gametime;
public OnGameFrame()
{
 //new flag=GetEntityFlags(client)  //FL_ONGROUND
 if( Enabled==0 )return;
 gametime=GetEngineTime();
   for (new client = 1; client <= MaxClients; client++)
 {
  if (JumpEnabled[client]  && IsClientInGame(client) && IsPlayerAlive(client) && !IsFakeClient(client))
  {
   Do(client);
  }
 }
 return;
}
new team;
new bool:canuse;
new Float:jumpspeed;
public Do(client)
{
 buttons = GetClientButtons(client);
 flag=GetEntityFlags(client);  //FL_ONGROUND

 hold=false;
 incap=false;
 jumpspeed=speed;
 ground=false;
 if((buttons & ReadyButton[client]))
 {
  if((buttons & IN_JUMP) && !(KeyBuffer[client] & IN_JUMP))
  {
   hold=true;
  }
  if(!(KeyBuffer[client] & ReadyButton[client]))
  {
   if(gametime-InpcapJumpTime[client]<=0.25)
   {
    //PrintToChatAll("%f ", gametime-InpcapJumpTime[client] );
    if(IsPlayerIncapped(client))
    {
     hold=true;
     incap=true;
     jumpspeed=speed_incap;

    }
   }
  }
  InpcapJumpTime[client]=gametime;
 }
 team=GetClientTeam(client);
 canuse=false;
 if(hold)
 {

  if(team==2)
  {
   canuse=true;
  }
  else if(team==3)
  {
   if(infecteduse==1)
   {
    canuse=true;
   }
   else if(infecteduse==2)
   {
    if(!IsPlayerTank(client))
    {
     canuse=true;
    }
   }
  }
  if(canuse)
  {
   if(FlagBuffer[client] & FL_ONGROUND)
   {
    ground=true;
   }
    GetClientAbsOrigin(client, clientpos);
   GetClientEyeAngles(client, clientangle);

    if(ground)
   {
    if(clientangle[0]>-20.0)clientangle[0]=-20.0;
    }
   else
   {

   }
   allow=false;
    if(!ground)
   {
     GetAngleVectors(clientangle,angledir, NULL_VECTOR, NULL_VECTOR);
    ScaleVector(angledir, -1.0);
    GetVectorAngles(angledir, reserveclientangle);

    trace = TR_TraceRayFilterEx(clientpos, reserveclientangle, /*MASK_SOLID*/ MASK_ALL,  RayType_Infinite, TraceEntityFilterPlayer);

    if(TR_DidHit(trace))
    {
     TR_GetEndPosition(hitpos, trace);
    }
    CloseHandle(trace);

    new Float:dis=GetVectorDistance(hitpos, clientpos);
    if(dis<distancediff)
    {
     allow=true;
     }

    if(!allow && anglediff1!=0.0)
    {
     reserveclientangle2[0]=reserveclientangle[0]-anglediff1;
     reserveclientangle2[1]=reserveclientangle[1];
     reserveclientangle2[2]=reserveclientangle[2];

     trace = TR_TraceRayFilterEx(clientpos, reserveclientangle2, MASK_ALL,  RayType_Infinite, TraceEntityFilterPlayer);

     if(TR_DidHit(trace))
     {
      TR_GetEndPosition(hitpos, trace);
     }
     CloseHandle(trace);

     dis=GetVectorDistance(hitpos, clientpos);
     if(dis<distancediff)
     {
      allow=true;
     }


    }
    if(false && !allow && anglediff2!=0.0)
    {
     reserveclientangle2[0]=0.0;
     reserveclientangle2[1]=reserveclientangle[1];
     reserveclientangle2[2]=reserveclientangle[2];
     reserveclientangle2[1]+=anglediff2;

     if(reserveclientangle2[1]>360.0)
     {
      reserveclientangle2[1]-=360.0;
     }

     trace = TR_TraceRayFilterEx(clientpos, reserveclientangle2, MASK_ALL,  RayType_Infinite, TraceEntityFilterPlayer);

     if(TR_DidHit(trace))
     {
      TR_GetEndPosition(hitpos, trace);
     }
     CloseHandle(trace);


     dis=GetVectorDistance(hitpos, clientpos);
     if(dis<distancediff)
     {
      allow=true;
     }
     }
    if(false && !allow && anglediff2!=0.0)
    {
     reserveclientangle2[0]=0.0;
     reserveclientangle2[1]=reserveclientangle[1];
     reserveclientangle2[2]=reserveclientangle[2];
     reserveclientangle2[1]+=(360.0-anglediff2);

     if(reserveclientangle2[1]>360.0)
     {
      reserveclientangle2[1]-=360.0;
     }

     trace = TR_TraceRayFilterEx(clientpos, reserveclientangle2, MASK_ALL,  RayType_Infinite, TraceEntityFilterPlayer);

     if(TR_DidHit(trace))
     {
      TR_GetEndPosition(hitpos, trace);
     }
     CloseHandle(trace);

     dis=GetVectorDistance(hitpos, clientpos);
     if(dis<distancediff)
     {
       allow=true;
     }

    }
    if(false && !allow && velocitydiff!=0.0)
    {
     GetEntDataVector(client, all_iVelocity, velocity);
     vel=GetVectorLength(velocity);
      if(vel<velocitydiff)
     {
      allow=true;
      }
     }
   }

   if(allow || ground)
   {
    GetAngleVectors(clientangle, clientdirection, NULL_VECTOR, NULL_VECTOR);
    NormalizeVector(clientdirection,clientdirection);
    {
     ScaleVector(clientdirection, jumpspeed);
    }
    if(incap)
    {
     clientpos[2]+=30.0;
      TeleportEntity(client, clientpos, NULL_VECTOR, clientdirection);
    }
    else
    {
     clientpos[2]+=20.0;
      TeleportEntity(client, clientpos, NULL_VECTOR, clientdirection);
    }
    FallVol[client]=0.0;

    OnAir[client]=1;
    MovementState[client]=0;

    if(team==2)
    {
     SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue",  movement);
     SetEntityGravity(client,1.0);
    }

    if(ground)PrintCenterText(client, "飞檐走壁");
    if(!ground)
    {
     EmitSoundToAll(SOUND_LANDING, client);
    }
    else
    {
     //EmitSoundToAll(SOUND_LANDING, client);
    }
    if(damage>0)
    {
     DamageEffect(client, team);
     }
    if(callboss>0)
    {
     random=GetRandomInt(0, 100);
     if(random<callboss)
     {
      CreateTimer(0.5, CallBoss, client);
     }
    }
   }
   else
   {
    PrintCenterText(client, "没有支撑点");
   }
  }
 }
 else
 {
  if(OnAir[client]==1)
  {
   if(flag & FL_ONGROUND)
   {
    if(team==2)
    {
     //SetEntProp(client, Prop_Data, "m_takedamage", 2, 1);
     SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue",  1.0);
     SetEntityGravity(client, 1.0);
     CreateTimer(0.3, NotGodMode, client);
    }
    OnAir[client]=0;
    MovementState[client]=0;
    SetEntityGravity(client,1.0);
    if(FallVol[client]>600.0)
    {
     new bool:shake=true;
     if(team==3)
     {
      if(GetEntData(client, FindSendPropInfo("CTerrorPlayer", "m_isGhost"), 1))
      {
       shake=false;
      }
     }
     if(shake)
     {
      GetClientAbsOrigin(client, clientpos);
      Shake(clientpos, FallVol[client]);
     }
     //PrintToChatAll("shake %f", FallVol[client]);
    }
    FallVol[client]=0.0;
    }
   else
   {
    GetEntDataVector(client, all_iVelocity, velocity);
    vel=GetVectorLength(velocity);
    //PrintToChatAll("%f", velocity[2]);
    if(0.0-velocity[2]>=FallVol[client])
    {
     FallVol[client]=0.0-velocity[2];
     //PrintToChatAll("shake %f", FallVol[client]);
    }
     if(0.0-velocity[2]>=safefallspeed)
    {
      //if(MovementState[client]==0 && team==2)
      if(team==2)
     {
      //PrintToChatAll("god %f", velocity[2]);
      if(godmode==1)
      {
       SetEntProp(client, Prop_Data, "m_takedamage", 0, 1);
      }
      else
      {
       SetEntityGravity(client,safegravity);
      }
     }
     MovementState[client]=1;
    }
    //else
    //{
    // if(MovementState[client]==1 && team==2)
    // {
    //  if(godmode==1)
    //  {

    //   CreateTimer(0.1, GodMode, client);
    //   //SetEntProp(client, Prop_Data, "m_takedamage", 2, 1);
    //  }
    //  else
    //  {
    //   SetEntityGravity(client,1.0);
    //  }
    //  }
    // MovementState[client]=0;

    //}

   }
  }
 }
 KeyBuffer[client]=buttons;
 FlagBuffer[client]=flag;

}
bool:IsPlayerTank (client)
{
 if(GetEntProp(client,Prop_Send,"m_zombieClass") == 5)
  return true;
 return false;
}
Shake(Float:pos[3], Float:vel)
{
  new ent1=CreateEntityByName("env_shake");
  DispatchKeyValueFloat(ent1, "amplitude", 16.0);
  DispatchKeyValueFloat(ent1, "radius", 300.0);
  DispatchKeyValueFloat(ent1, "duration", 0.5);
  DispatchKeyValueFloat(ent1, "frequency", 255.0);
 DispatchSpawn(ent1);
 TeleportEntity(ent1, pos, NULL_VECTOR, NULL_VECTOR);
  AcceptEntityInput(ent1, "StartShake");
  CreateTimer(1.0, StopShake, ent1);

 new push = CreateEntityByName("point_push");
   DispatchKeyValueFloat (push, "magnitude", vel);
 DispatchKeyValueFloat (push, "radius", 300.0);
   SetVariantString("spawnflags 24");
 AcceptEntityInput(push, "AddOutput");
  DispatchSpawn(push);
 TeleportEntity(push, pos, NULL_VECTOR, NULL_VECTOR);
  AcceptEntityInput(push, "Enable", -1, -1);
 CreateTimer(0.1, DeletePushForce, push);

 EmitAmbientSound(SOUND_LANDING2, pos, SOUND_FROM_WORLD, SNDLEVEL_RAIDSIREN);

}
public Action:DeletePushForce(Handle:timer, any:ent)
{
    if (IsValidEntity(ent))
    {
        new String:classname[64];
        GetEdictClassname(ent, classname, sizeof(classname));
        if (StrEqual(classname, "point_push", false))
  {
    AcceptEntityInput(ent, "Disable");
   AcceptEntityInput(ent, "Kill");
   RemoveEdict(ent);
  }
    }
}
public Action:StopShake(Handle:timer, any:ent)
{
    if (IsValidEntity(ent))
    {
   AcceptEntityInput(ent, "Kill");
  RemoveEdict(ent);
    }
}
bool:IsPlayerIncapped(client)
{
 if (GetEntProp(client, Prop_Send, "m_isIncapacitated", 1)) return true;
  return false;
}
public Action:NotGodMode(Handle:timer, any:client)
{
    if (IsClientInGame(client) && IsPlayerAlive(client))
    {
  SetEntProp(client, Prop_Data, "m_takedamage", 2, 1);
  //PrintToChatAll("stop god ");
 }
}
public Action:CallBoss(Handle:timer, any:client)
{
 if(IsClientInGame(client) && IsPlayerAlive(client) && GetClientTeam(client)==2)
 {
   PrintToChat(client, "\x01[sea]\x03你的行为招来了感染者的嫉妒");
   new r=GetRandomInt(0,100);
   if(r<30)CheatCommand(client, "z_spawn", "boomer", "" );
     else if(r<60)CheatCommand(client, "z_spawn", "hunter", "" );
     else if(r<90)CheatCommand(client, "z_spawn", "smoker", "" );
     else CheatCommand(client, "z_spawn", "witch", "" );
 }
}
 public AddParticle( String:s_Effect[100], Float:f_Origin[3])
{
 decl i_Particle, String:s_TargetName[32];

 i_Particle = CreateEntityByName("info_particle_system");

 if (IsValidEdict(i_Particle))
 {
  TeleportEntity(i_Particle, f_Origin, NULL_VECTOR, NULL_VECTOR);
    DispatchKeyValue(i_Particle, "effect_name", s_Effect);
  DispatchSpawn(i_Particle);
   ActivateEntity(i_Particle);
  AcceptEntityInput(i_Particle, "Start");
  CreateTimer(5.0, KillParticle, i_Particle);
 }

 return i_Particle;
}
public Action:KillParticle(Handle:timer, any:i_Particle)
{
 if (IsValidEntity(i_Particle))
    {
         RemoveEdict(i_Particle);
    }
}
public Action:DamagePlayer(Handle:timer, any:client)
{
 new team=GetClientTeam(client);
 DamageEffect(client, team);
}
stock DamageEffect(target, team)
{

 new String:N[20];
 Format(N, 20, "target%d", target);
 new pointHurt = CreateEntityByName("point_hurt");   // Create point_hurt
 DispatchKeyValue(target, "targetname", N);   // mark target
 if(team==2)
  DispatchKeyValue(pointHurt, "Damage", sdemage);     // No Damage, just HUD display. Does stop Reviving though
 else
  DispatchKeyValue(pointHurt, "Damage", sdemage2);     // No Damage, just HUD display. Does stop Reviving though
 DispatchKeyValue(pointHurt, "DamageTarget", N);  // Target Assignment
 DispatchKeyValue(pointHurt, "DamageType", "65536");   // Type of damage
 DispatchSpawn(pointHurt);         // Spawn descriped point_hurt
 AcceptEntityInput(pointHurt, "Hurt");       // Trigger point_hurt execute
 AcceptEntityInput(pointHurt, "Kill");       // Remove point_hurt
 //DispatchKeyValue(target, "targetname", "cake");   // Clear target's mark
 return;
}


public Action:RoundEnd(Handle:event, const String:name[], bool:dontBroadcast)
{
  if(timer_handle != INVALID_HANDLE )
  {
  KillTimer(timer_handle);
  timer_handle=INVALID_HANDLE;
 }

 return Plugin_Continue;
}

public Action:RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{

 if(timer_handle != INVALID_HANDLE )
 {
  KillTimer(timer_handle);
  timer_handle=INVALID_HANDLE;
 }

 timer_handle=CreateTimer(GetConVarFloat(l4d_fyzb_showtime), Msg, 0, TIMER_REPEAT);
 Reset();
 return Plugin_Continue;
}

stock CheatCommand(client, String:command[], String:parameter1[], String:parameter2[])
{
 new userflags = GetUserFlagBits(client);
 SetUserFlagBits(client, ADMFLAG_ROOT);
 new flags = GetCommandFlags(command);
 SetCommandFlags(command, flags & ~FCVAR_CHEAT);
 FakeClientCommand(client, "%s %s %s", command, parameter1, parameter2);
 SetCommandFlags(command, flags);
 SetUserFlagBits(client, userflags);
}

Reset()
{
 new bool:e=GetConVarInt(l4d_fyzb_init)>0;
 for (new x = 1; x   <=MaxClients ; x++)
 {
   JumpEnabled[x]=e;
  ReadyButton[x]=IN_SPEED;
   FlagBuffer[x]=0;
  OnAir[x]=0;
   MovementState[x]=0;
  if(IsClientInGame(x) && IsPlayerAlive(x))
  {
   SetEntPropFloat(x, Prop_Data, "m_flLaggedMovementValue",  1.0);
   SetEntityGravity(x,1.0);
   SetEntProp(x, Prop_Data, "m_takedamage", 2, 1);
  }
 }
}
public bool:TraceEntityFilterPlayer(entity, contentsMask)
{
 return (entity > GetMaxClients() || !entity);
}
评论 (0)

Click here to cancel reply.

欢迎您 游客  

近期文章

  • 用于网速测试的下载测速文件合集
  • docker构建SB镜像
  • pterodactl docker install
  • OpenWRT流量实时监控插件
  • docker部署dify

近期评论

No comments to show.

归档

  • 1 月 2026
  • 8 月 2025
  • 5 月 2025
  • 4 月 2025
  • 3 月 2025
  • 2 月 2025
  • 12 月 2024
  • 4 月 2024
  • 10 月 2023
  • 8 月 2023
  • 4 月 2023
  • 3 月 2023
  • 2 月 2023
  • 10 月 2021
  • 5 月 2021
  • 3 月 2021
  • 2 月 2021

分类

  • 数据库
  • 服务器相关
  • 未分类
  • 游戏相关
  • 电脑相关
  • 路由器
Copyright © 2026
smarty_hankin 主题. Designed by hankin
主页
页面
  • 关于
博主
hkthomas 管理员
136 文章 0 评论 18290 浏览
测试
测试