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

Team/player speed


Post New Thread Reply   
 
Thread Tools Display Modes
Mitchell
~lick~
Join Date: Mar 2010
Old 10-17-2010 , 22:04   Re: Team/player speed
Reply With Quote #11

Whos your debugger?
Mitchell is offline
thetwistedpanda
Good Little Panda
Join Date: Sep 2008
Old 10-17-2010 , 22:12   Re: Team/player speed
Reply With Quote #12

Pesky forum bug that won't let me see the second page. Begone you demon!
__________________
thetwistedpanda is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 10-17-2010 , 22:22   Re: Team/player speed
Reply With Quote #13

That happens to me alot now :O
Mitchell is offline
Sammy-ROCK!
Senior Member
Join Date: Jun 2008
Location: Near Mrs.Lag
Old 10-17-2010 , 22:51   Re: Team/player speed
Reply With Quote #14

Quote:
Originally Posted by Mitchell View Post
Whos your debugger?
IDA
Sammy-ROCK! is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 10-18-2010 , 01:09   Re: Team/player speed
Reply With Quote #15

Here's something that partially worked: http://forums.alliedmods.net/showthr...67#post1318967

And here's why I think it's laggy: http://forums.alliedmods.net/showthr...88#post1322588
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)
rhelgeby is offline
Send a message via MSN to rhelgeby
russy
Senior Member
Join Date: Sep 2010
Old 10-19-2010 , 12:51   Re: Team/player speed
Reply With Quote #16

sorry panda's way worked i tried to post saying it did ages ago but the forum went down
russy is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 10-19-2010 , 12:58   Re: Team/player speed
Reply With Quote #17

The lagged movement value method works, but it has some bad side effects that affect jump and fall speed.
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)
rhelgeby is offline
Send a message via MSN to rhelgeby
Sammy-ROCK!
Senior Member
Join Date: Jun 2008
Location: Near Mrs.Lag
Old 10-19-2010 , 14:12   Re: Team/player speed
Reply With Quote #18

Good news: Found a new virtual void at CCSPlayer
426 CCSPlayer::GetPlayerMaxSpeed(void)

It's code: (a1 = the CCSPlayer entity)
Code:
long double __cdecl CCSPlayer__GetPlayerMaxSpeed(int a1)
{
  int v1; // eax@3
  long double result; // fst7@6
  int v5; // eax@12
  int v6; // edi@13
  float v7; // [sp+10h] [bp-28h]@10

  if ( !*(_BYTE *)(a1 + 326) )
    goto LABEL_20;
  if ( *(_BYTE *)(a1 + 2720) & 8 )
    return 900.0;
  if ( (v1 = *(_DWORD *)(a1 + 4348)) != 0 && v1 != 6
    || *(_BYTE *)(a1 + 4376)
    || (unsigned __int8)CCSGameRules__IsFreezePeriod(g_pGameRules) )
  {
LABEL_20:
    result = 1.0;
  }
  else
  {
    _FST6 = CBasePlayer__GetPlayerMaxSpeed(a1);
    _FST7 = 240.0;
    __asm { fcmovnbe st, st(1) }
    v7 = _FST6;
    if ( (unsigned __int8)CCSPlayer__IsVIP(a1) )
    {
      result = 227.0;
    }
    else
    {
      v5 = CBaseCombatCharacter__GetActiveWeapon(a1);
      result = v7;
      if ( v5 )
      {
        v6 = __dynamic_cast(v5, _typeinfo_for_CBaseCombatWeapon, _typeinfo_for_CWeaponCSBase, 0);
        result = v7;
        if ( v6 )
        {
          if ( (unsigned __int8)CCSPlayer__HasShield(a1) && (unsigned __int8)CCSPlayer__IsShieldDrawn(a1) )
            result = 160.0;
          else
            (*(void (__cdecl **)(int))(*(_DWORD *)v6 + 1456))(v6);
        }
      }
    }
  }
  return result;
}
I'll work on a SourceHook and release it as soon as it's ready.
Sammy-ROCK! is offline
Sammy-ROCK!
Senior Member
Join Date: Jun 2008
Location: Near Mrs.Lag
Old 10-19-2010 , 15:54   Re: Team/player speed
Reply With Quote #19

http://forums.alliedmods.net/showthread.php?t=141109

Try it out and lemme know if it works :-)
Sammy-ROCK! is offline
russy
Senior Member
Join Date: Sep 2010
Old 10-19-2010 , 16:18   Re: Team/player speed
Reply With Quote #20

Quote:
Originally Posted by thetwistedpanda View Post
Uhm, no, not like that. You'd have to do something like:
PHP Code:
public OnGameFrame()
{
        for(new 
1<= MaxClientsi++)
        {
            
//Strongly advised you create an array and manually monitor the client's team,
            // rather than calling this native every frame. I.e., in player_team, 
            // g_iTeam[client] = <their new team>. Then Check g_iTeam[client] vs CS_TEAM_T
            
if (IsClientInGame(i) && GetClientTeam(i) == CS_TEAM_T)
                if (
GetEntPropFloat(iProp_Data"m_flLaggedMovementValue") == 1.0)
                    
SetEntPropFloat(iProp_Data"m_flLaggedMovementValue"1.1);
        }

And this would work for slowing down CT that are NOT holding a knife?

PHP Code:
public OnGameFrame()
{
        for(new 
1<= MaxClientsi++)
        {
            if (
IsClientInGame(i) && GetClientTeam(i) == CS_TEAM_CT)
        {      
        
GetEventString(event,"weapon",Weapon,30);
          if(
StrEqual(Weapon,"knife")== true && GetConVarInt(Switch))
                if (
GetEntPropFloat(iProp_Data"m_flLaggedMovementValue") == 1.0)
                    
SetEntPropFloat(iProp_Data"m_flLaggedMovementValue"0.95);
        }
        }

russy 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 14:23.


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