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

Changing Clients Speed Without using "m_flLaggedMovementValue"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Master53
Veteran Member
Join Date: Dec 2009
Old 06-21-2010 , 18:21   Changing Clients Speed Without using "m_flLaggedMovementValue"
Reply With Quote #1

i want to change teh clients speed by using something else than "m_flLaggedMovementValue" because it gliches the player everytime they move over objects or jump and wont work for what im making
__________________
Master(d)



Master53 is offline
iloveportalz0r
Member
Join Date: May 2010
Location: Up yours
Old 06-21-2010 , 21:40   Re: Changing Clients Speed Without using "m_flLaggedMovementValue"
Reply With Quote #2

I think there's a thing called m_vecVelocity in players. No idea if it's related to that though.
__________________
I sure was dumb in 2010
iloveportalz0r is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 06-22-2010 , 03:40   Re: Changing Clients Speed Without using "m_flLaggedMovementValue"
Reply With Quote #3

Changing speed as a velocity bad idea
__________________
xbatista is offline
Send a message via Skype™ to xbatista
Paah
Junior Member
Join Date: Jan 2010
Old 06-22-2010 , 08:25   Re: Changing Clients Speed Without using "m_flLaggedMovementValue"
Reply With Quote #4

SetEntPropFloat(client, Prop_Send, "m_flMaxspeed", XX)

Works for TF2 atleast.
Paah is offline
Master53
Veteran Member
Join Date: Dec 2009
Old 06-22-2010 , 10:44   Re: Changing Clients Speed Without using "m_flLaggedMovementValue"
Reply With Quote #5

yes i actually did try and use m_flMaxspeed but i got no result from my test i did.
__________________
Master(d)



Master53 is offline
Master53
Veteran Member
Join Date: Dec 2009
Old 06-22-2010 , 11:07   Re: Changing Clients Speed Without using "m_flLaggedMovementValue"
Reply With Quote #6

i actually found this in my database of scripts. would this do the trick?

PHP Code:
public OnPluginStart() {
    
LoadTranslations("common.phrases");
    
RegConsoleCmd("set_speed"CmdSetSpeed)
}

public 
Action:CmdSetSpeed(clientargs) {
    
//arg0 is set_speed
    
decl String:arg1[32]
    
decl String:arg2[32]
    
GetCmdArg(1arg1sizeof(arg1))
    
GetCmdArg(2arg2sizeof(arg2))
    new 
target
    target 
FindTarget(clientarg1truefalse)
    new 
Float:flspeed StringToFloat(arg2)
    
    
CustomSetSpeed(targetflspeed0)
}
stock CustomSetSpeed(entFloat:speedmode, const Float:origin[3] = {0.0,0.0,0.0} )
{
    if(!
ent)
        return 
0;
    
    switch(
mode)
    {
        case 
0:
        {
            new 
Float:f_Velocity[3];
            
GetEntityVelocity(ent,f_Velocity);
            
            new 
Float:y;
            
f_Velocity[0] * f_Velocity[0] + f_Velocity[1] * f_Velocity[1];
            
            new 
Float:x;
            if(
ySquareRoot(speed speed y);
            
            
f_Velocity[0] *= x;
            
f_Velocity[1] *= x;
            
            if(
speed 0.0)
            {
                
f_Velocity[0] *= -1;
                
f_Velocity[1] *= -1;
            }
            
            
SetEntityVelocity(ent,f_Velocity);
        }

        case 
1:
        {
            new 
Float:f_Velocity[3];
            
GetEntityVelocity(ent,f_Velocity);
            
            new 
Float:y;
            
f_Velocity[0] * f_Velocity[0] + f_Velocity[1] * f_Velocity[1] + f_Velocity[2] * f_Velocity[2];
            
            new 
Float:x;
            if(
ySquareRoot(speed speed y);
            
            
f_Velocity[0] *= x;
            
f_Velocity[1] *= x;
            
f_Velocity[2] *= x;

            if(
speed 0.0)
            {
                
f_Velocity[0] *= -1;
                
f_Velocity[1] *= -1;
                
f_Velocity[2] *= -1;
            }
            
            
SetEntityVelocity(ent,f_Velocity);
        }
        case 
2:
        {
            new 
Float:fOrigin[3];
            
GetEntityOrigin(ent,fOrigin);
            
            new 
Float:f_NewVelo[3];
            
            
f_NewVelo[0] = origin[0] - fOrigin[0];
            
f_NewVelo[1] = origin[1] - fOrigin[1];
            
f_NewVelo[2] = origin[2] - fOrigin[2];
            
            new 
Float:y;
            
f_NewVelo[0] * f_NewVelo[0] + f_NewVelo[1] * f_NewVelo[1] + f_NewVelo[2] * f_NewVelo[2];
            
            new 
Float:x;
            if(
ySquareRoot(speed speed y);
            
            
f_NewVelo[0] *= x;
            
f_NewVelo[1] *= x;
            
f_NewVelo[2] *= x;
            
            if(
speed 0.0)
            {
                
f_NewVelo[0] *= -1;
                
f_NewVelo[1] *= -1;
                
f_NewVelo[2] *= -1;
            }
            
            
SetEntityVelocity(ent,f_NewVelo);
        }

        default: return 
0;
    }
    return 
1;
}

stock GetEntityVelocity(ent,Float:velocity[3]) 
{
    
// m_vecVelocity
    
return GetEntPropVector(ent,Prop_Data,"m_vecVelocity",velocity);
}

stock SetEntityVelocity(ent,Float:velocity[3]) 
{
    
// m_vecVelocity
    
return SetEntPropVector(ent,Prop_Data,"m_vecVelocity",velocity);
}

stock GetEntityOrigin(entFloat:fOrigin[3])
{
    
// m_vecOrigin
    
return GetEntPropVector(ent,Prop_Data,"m_vecOrigin",fOrigin);

__________________
Master(d)



Master53 is offline
LumiStance
AlliedModders Donor
Join Date: Jan 2009
Location: Northern California
Old 07-31-2010 , 23:16   Re: Changing Clients Speed Without using "m_flLaggedMovementValue"
Reply With Quote #7

Whats wrong with
Code:
native TeleportEntity(entity, const Float:origin[3], const Float:angles[3], const Float:velocity[3]);
__________________
LumiStance is offline
javalia
Senior Member
Join Date: May 2009
Location: korea, republic of
Old 08-01-2010 , 01:10   Re: Changing Clients Speed Without using "m_flLaggedMovementValue"
Reply With Quote #8

i made this code for my tactical gunmod`s maximum speed suit fucntion

lol this code is crap but it works lol

Code:
if(suitmode[client] == suitmode_speed){
            
            if(((buttons & IN_FORWARD) || (buttons & IN_BACK) || (buttons & IN_MOVELEFT) || (buttons & IN_MOVERIGHT)) && !(buttons & IN_DUCK) && !(buttons & IN_SPEED) && (GetEntityFlags(client) & FL_ONGROUND)){
                
                if(armorvalue >= SUIT_SPEED_ENERGY){
                
                    decl Float:playerspeed[3], Float:clienteyeangle[3], Float:anglevector[3];
                    GetEntPropVector(client, Prop_Data, "m_vecVelocity", playerspeed);
                    
                    GetClientEyeAngles(client, clienteyeangle);
                    clienteyeangle[0] = 0.0;
                    
                    //플레이어의 위와 아래로 가는 속도는 기존 속도에서 가져오고,
                    //플레이어가 갈 방향의 속도를 플레이어의 눈 각도로부터 만든 벡터에서 가져온다
                    //눌린 이동버튼의 조합을 통해서 이동할 방향을 구한다
                    
                    //앞이나 뒤중 하나만이 눌려있거나 아무것도 눌려선 안된다
                    if(((buttons & IN_FORWARD) && !(buttons & IN_BACK)) || (!(buttons & IN_FORWARD) && (buttons & IN_BACK))|| (!(buttons & IN_FORWARD) && !(buttons & IN_BACK))){
                        
                        //좌나 우중 하나 혹은 아무것도 눌려있어선 안된다
                        if(((buttons & IN_MOVELEFT) && !(buttons & IN_MOVERIGHT)) || (!(buttons & IN_MOVELEFT) && (buttons & IN_MOVERIGHT)) || (!(buttons & IN_MOVELEFT) && !(buttons & IN_MOVERIGHT))){
                            
                            //앞으로 가기 버튼이 눌린 경우
                            if(buttons & IN_FORWARD){
                                
                                //왼쪽이 눌린 경우
                                if(buttons & IN_MOVELEFT){
                                    
                                    clienteyeangle[1] = clienteyeangle[1] + 45.0;
                                    
                                }else if(buttons & IN_MOVERIGHT){
                                    
                                    //오른쪽이 눌린 경우
                                    clienteyeangle[1] = clienteyeangle[1] - 45.0;
                                    
                                }
                                
                            }else if(buttons & IN_BACK){
                                
                                //방향을 뒤로
                                clienteyeangle[1] = clienteyeangle[1] + 180.0;
                                
                                //왼쪽이 눌린 경우
                                if(buttons & IN_MOVELEFT){
                                    
                                    clienteyeangle[1] = clienteyeangle[1] - 45.0;
                                    
                                }else if(buttons & IN_MOVERIGHT){
                                    
                                    //오른쪽이 눌린 경우
                                    clienteyeangle[1] = clienteyeangle[1] + 45.0;
                                    
                                }
                                
                            }else{
                                
                                //왼쪽이 눌린 경우
                                if(buttons & IN_MOVELEFT){
                                    
                                    clienteyeangle[1] = clienteyeangle[1] + 90.0;
                                    
                                }else if(buttons & IN_MOVERIGHT){
                                    
                                    //오른쪽이 눌린 경우
                                    clienteyeangle[1] = clienteyeangle[1] - 90.0;
                                    
                                }
                                
                            }
                            
                        }
                        
                    }
                    
                    GetAngleVectors(clienteyeangle, anglevector, NULL_VECTOR, NULL_VECTOR);
                    NormalizeVector(anglevector, anglevector);
                    ScaleVector(anglevector, 40.0);
                    AddVectors(playerspeed, anglevector, playerspeed);
                    
                    if(GetVectorLength(playerspeed) >= SUIT_SPEED_MAXSPEED){
                        
                        NormalizeVector(playerspeed, playerspeed);
                        ScaleVector(playerspeed, SUIT_SPEED_MAXSPEED);
                        
                    }
                    
                    TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, playerspeed);
                    
                    if(nextsuitactivetime[client] < nowtime){
                    
                        nextsuitactivetime[client] = nowtime + SUIT_SPEED_DELAY;
                        SetEntProp(client, Prop_Data, "m_ArmorValue", armorvalue - SUIT_SPEED_ENERGY); 
                        
                    }
                    
                }else{
                    
                    PrintToChat(client, "\x04%T", "suitenergydepleted", client);
                    nextsuitactivetime[client] = nowtime + SUIT_CHARGE_DELAY;
                    suitmode[client] = suitmode_charge;
                    
                    cancelreservesuithelpsound(client);
                    playsuithelpsound(client, SOUNDSUITNOENERGY);
                    
                }
                
            }
            
        }
javalia is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 08-01-2010 , 04:48   Re: Changing Clients Speed Without using "m_flLaggedMovementValue"
Reply With Quote #9

http://code.google.com/p/zombiereloa...repo=zr-3-0-b2

Have a look at:
g_flClassApplySpeed (array with speed values)
ClassPreThinkPost (pre think post hook by SDK Hooks)
Class_OnPlayerRunCmd (hack to bypass client speed limit)
__________________
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
javalia
Senior Member
Join Date: May 2009
Location: korea, republic of
Old 08-01-2010 , 08:04   Re: Changing Clients Speed Without using "m_flLaggedMovementValue"
Reply With Quote #10

as comment of rhelgeby, it was able to change client`s max move speed by
sdkhooks prethinkpost hook and setting m_flmaxspeed on that hook.
u must do it on prethinkpost hook, not other think hooks.
javalia 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 12:47.


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