Raised This Month: $ Target: $400
 0% 

Cheat cvars


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 02-21-2010 , 18:18   Cheat cvars
Reply With Quote #1

Is it possible to remove the cheat flag on client convars?

cl_forwardspeed is the only thing limiting run-speed in CS:S after changing m_flMaxspeed. It's a client-side cheat cvar that won't allow their speed to exceed that number and I want to go above it.


Any way to do this?
__________________
Greyscale is offline
Sammy-ROCK!
Senior Member
Join Date: Jun 2008
Location: Near Mrs.Lag
Old 02-21-2010 , 18:36   Re: Cheat cvars
Reply With Quote #2

have you checked sv_maxspeed?
Sammy-ROCK! is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 02-21-2010 , 18:48   Re: Cheat cvars
Reply With Quote #3

sv_maxspeed defaults to 320, if you increase that to say 1000, cl_forwardspeed still caps it at 400.

It's like 2 layers of clamping.
__________________
Greyscale is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 02-21-2010 , 18:56   Re: Cheat cvars
Reply With Quote #4

the clients speed is limited by sv_maxspeed and the cl_ cvars, whichever is lowest.

i have a method that works for a script i'm working on, first set sv_maxspeed to your maximum speed, lets say 1000, then in OnPlayerRunCmd check vel[0] and vel[1] to see if they're 400/-400 then change them to your max speed 1000/-1000. the client always sends the max speed limited by the cl_ cvars.
blodia is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 02-21-2010 , 19:07   Re: Cheat cvars
Reply With Quote #5

So changing the 'vel' vector in OnPlayerRunCmd to the sv_maxspeed will fix it?
__________________
Greyscale is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 02-21-2010 , 19:50   Re: Cheat cvars
Reply With Quote #6

only the 1st 2 elements of the array, and you have to check if its positive or negative, oh yeah you also have to multiply it by 1.1363636 so if its -400 then -(sv_maxspeed)*1.1363636 and for 400 its sv_maxspeed*1.1363636.
blodia is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 02-21-2010 , 20:16   Re: Cheat cvars
Reply With Quote #7

I'm confused.

Where does 1.1363636 come from? And wouldn't the magnitude of the first 2 elements be what I need to pay attention to?

Can I just do vel[0] = 1000.0; vel[1] = 1000.0 ?

Maybe a snippet of your code would explain better.
__________________
Greyscale is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 02-22-2010 , 03:53   Re: Cheat cvars
Reply With Quote #8

Almost. The vel array is a vector (as I you already knew I think), so the length of the vector is the speed. You need to calculate the first two elements based on the speed you want, or all elements if you want vertical speed too.
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)

Last edited by rhelgeby; 02-22-2010 at 03:56.
rhelgeby is offline
Send a message via MSN to rhelgeby
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 02-22-2010 , 07:24   Re: Cheat cvars
Reply With Quote #9

i haven't cleaned up the code as i was testing it to see if it worked as i hoped.

PHP Code:
public Action:OnPlayerRunCmd(client, &buttons, &impulseFloat:vel[3], Float:angles[3], &weapon)
{
    if (
vel[0] != 0.0)
    {
        if (
vel[0] < 0.0vel[0] = -600 1.1363636;
        if (
vel[0] > 0.0vel[0] = 600 1.1363636;
    }
    if (
vel[1] != 0.0)
    {
        if (
vel[1] < 0.0vel[1] = -600 1.1363636;
        if (
vel[1] > 0.0vel[1] = 600 1.1363636;
    }
    return 
Plugin_Continue;

the 3rd element is always 0 from what i saw. the 1st 2 are either -400, 0 or 400 so you don't need to find the length of the vector as it is either 0 or 400, acceleration is processed sometime after this info is passed to the server. its negative and positive to relate to which direction the client is moving e.g back or forward. when i changed the values and tested them i saw the actual maxspeed was less than the value i was testing (600 in the snippet), after trying a few values i found i had to multiply the value i wanted by 1.1363636.
blodia is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 02-24-2010 , 14:33   Re: Cheat cvars
Reply With Quote #10

i don't know if you have got it working how you want Greyscale but i've been doing more tests and it seems as though you don't have to multiply by 1.1363636, i was using cl_showpos to check my speed and since its capped clientside to 400 and i was changing on the server side the display wasn't correct. so this should work fine

PHP Code:
public Action:OnPlayerRunCmd(client, &buttons, &impulseFloat:vel[3], Float:angles[3], &weapon)
{

    if (
vel[0] < 0.0vel[0] = -1.0 * <variable containing sv_maxspeed>;
    if (
vel[0] > 0.0vel[0] = <variable containing sv_maxspeed>;
    if (
vel[1] < 0.0vel[1] = -1.0 * <variable containing sv_maxspeed>;
    if (
vel[1] > 0.0vel[1] = <variable containing sv_maxspeed>;

    return 
Plugin_Continue;


Last edited by blodia; 02-24-2010 at 14:47.
blodia 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 02:54.


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