Advertisement
FlacoBey

Untitled

Jan 18th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.02 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdktools>
  3.  
  4. public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
  5. {
  6.     static Float:LeftGroundMaxSpeed[MAXPLAYERS + 1];
  7.  
  8.     if (IsPlayerAlive(client))
  9.     {
  10.         if(GetClientTeam(client) == 3 && GetEntProp(client, Prop_Send, "m_zombieClass") == 3)
  11.         {
  12.             return Plugin_Continue;
  13.         }
  14.  
  15.         if (GetEntityFlags(client) & FL_ONGROUND)
  16.         {
  17.             if (LeftGroundMaxSpeed[client] != -1.0)
  18.             {
  19.                 decl Float:CurVelVec[3];
  20.                 GetEntPropVector(client, Prop_Data, "m_vecAbsVelocity", CurVelVec);
  21.                
  22.                 if (GetVectorLength(CurVelVec) > LeftGroundMaxSpeed[client])
  23.                 {
  24.                     NormalizeVector(CurVelVec, CurVelVec);
  25.                     ScaleVector(CurVelVec, LeftGroundMaxSpeed[client]);
  26.                     TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, CurVelVec);
  27.                 }
  28.                 LeftGroundMaxSpeed[client] = -1.0;
  29.             }
  30.         }
  31.         else if(LeftGroundMaxSpeed[client] == -1.0)
  32.         {
  33.             LeftGroundMaxSpeed[client] = GetEntPropFloat(client, Prop_Data, "m_flMaxspeed");
  34.         }
  35.     }
  36.    
  37.     return Plugin_Continue;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement