Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #include <sdktools>
- public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
- {
- static Float:LeftGroundMaxSpeed[MAXPLAYERS + 1];
- if (IsPlayerAlive(client))
- {
- if(GetClientTeam(client) == 3 && GetEntProp(client, Prop_Send, "m_zombieClass") == 3)
- {
- return Plugin_Continue;
- }
- if (GetEntityFlags(client) & FL_ONGROUND)
- {
- if (LeftGroundMaxSpeed[client] != -1.0)
- {
- decl Float:CurVelVec[3];
- GetEntPropVector(client, Prop_Data, "m_vecAbsVelocity", CurVelVec);
- if (GetVectorLength(CurVelVec) > LeftGroundMaxSpeed[client])
- {
- NormalizeVector(CurVelVec, CurVelVec);
- ScaleVector(CurVelVec, LeftGroundMaxSpeed[client]);
- TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, CurVelVec);
- }
- LeftGroundMaxSpeed[client] = -1.0;
- }
- }
- else if(LeftGroundMaxSpeed[client] == -1.0)
- {
- LeftGroundMaxSpeed[client] = GetEntPropFloat(client, Prop_Data, "m_flMaxspeed");
- }
- }
- return Plugin_Continue;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement