Raised This Month: $32 Target: $400
 8% 

Solved [REQ] TF2 (Fix Spy Improvement) [Solved]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
isinho
New Member
Join Date: Sep 2022
Location: Brazil
Old 09-22-2022 , 14:25   [REQ] TF2 (Fix Spy Improvement) [Solved]
Reply With Quote #1

It is my first post here. I am making a request since I have No knowledge on writing plugins and because the server owner using it, hes stubborn.
The plugin thread : Spy Improvement

theres this old simple plugin, it gives faster walk speed for spys while clocked
but as it is an old plugin theres some issues

List of issues : Spy walkspeed is set to (300) instead of (320) , Spy walkspeed is capped
Dead Ringer Speed boost, Discplinary Action Speed boost, Concheror Speed boost / (Any)
rtd Speed boost doesnt work, (vsh) GentleSpy and others Hales with spy, all speed is capped at 300
ANY Walk Speed Boost Doesnt Work!


able to walk at 320
walk speed boosts working Going out of dead ringer Etc
keep server owner being able to adjust the cloaked walkspeed

Spy Improvement

Actually found another plugin that does the same thing and it works
QuickCloak




PHP Code:
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <tf2>
#include <tf2_stocks>

#define PLUGIN_VERSION "1.3"
#define PLUGIN_PREFIX "\x04[Spy Improvements]\x01"

public Plugin:myinfo 
{
    
name "Spy Improvements",
    
author "Matheus28",
    
description "",
    
version PLUGIN_VERSION,
    
url ""
}

new 
speedOffset;

new 
Float:spySpeed;

new 
Handle:cv_admin;
new 
Handle:cv_cloakedSpeed;

public 
OnPluginStart(){
    
CreateConVar("sm_spyi_version"PLUGIN_VERSION"Spy Improvements Version",
    
FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
    
    
cv_admin CreateConVar("sm_spyi_admin""0",
    
"If 1, only admins with with access to sm_spyi will be able to use the improvements",
    
FCVAR_PLUGIN|FCVAR_NOTIFYtrue0.0true1.0);
    
    
cv_cloakedSpeed CreateConVar("sm_spyi_cloaked_speed""350.0",
    
"Spy speed when he is cloaked, 300 = Disabled",
    
FCVAR_PLUGIN|FCVAR_NOTIFYtrue220.0true400.0);
    
    
    
spySpeed TF2_GetClassBaseSpeed(TFClass_Spy);
    
speedOffset FindSendPropInfo("CTFPlayer""m_flMaxspeed");
}

public 
OnGameFrame(){
    new 
bool:adminOnly GetConVarBool(cv_admin);
    new 
Float:cloakedSpeed GetConVarFloat(cv_cloakedSpeed);
    
    for(new 
i=1;i<=MaxClients;++i){
        if(!
IsClientInGame(i)) continue;
        if(
TF2_GetPlayerClass(i)!=TFClass_Spy) continue;
        if(!
IsPlayerAlive(i)) continue;
        if(
adminOnly
        
&& !CheckCommandAccess(i"sm_spyi"ADMFLAG_RESERVATION)){
            continue;
        }
        
        new 
buttons=GetClientButtons(i);
        new 
flags=TF2_GetPlayerConditionFlags(i);
        
        if(
cloakedSpeed!=spySpeed){
            if(
flags TF_CONDFLAG_CLOAKED){
                if(
GetEntDataFloat(ispeedOffset)!=cloakedSpeed){
                    
SetEntDataFloat(ispeedOffsetcloakedSpeedtrue);
                }
            }else{
                if(
GetEntDataFloat(ispeedOffset)==cloakedSpeed){
                    
SetEntDataFloat(ispeedOffsetspySpeedtrue);
                }
                if(
buttons IN_RELOAD){
                    
SetEntDataFloat(ispeedOffsetspySpeedtrue);
                }else{
                    
SetSpyDisguiseSpeed(i);
                }
            }
        }
    }
}

stock SetSpyDisguiseSpeed(i){
    new 
TFClassType:class = TFClassType:GetEntProp(iProp_Send"m_nDisguiseClass");
    new 
Float:speed;
    if(!(
TF2_GetPlayerConditionFlags(i) & TF_CONDFLAG_DISGUISED)){
        
speed=spySpeed;
    }else{
        
speed=TF2_GetClassBaseSpeed(class);
        if(
speed>spySpeed){
            
speed=spySpeed;
        }
    }
    
SetEntDataFloat(ispeedOffsetspeedtrue);
}



stock Float:TF2_GetClassBaseSpeed(TFClassType:class){
    switch (class){
        case 
TFClass_Scout:     return 400.0;
        case 
TFClass_Soldier:   return 240.0;
        case 
TFClass_DemoMan:   return 280.0;
        case 
TFClass_Medic:     return 320.0;
        case 
TFClass_Heavy:     return 230.0;
    }
    return 
300.0;
}

stock IsValid(i){
    if(
i>MaxClients) return false;
    if(
i<=0) return false;
    return 
IsClientInGame(i);


Last edited by isinho; 11-09-2022 at 05:23. Reason: Solved
isinho is offline
MeatwadMeatwad
Junior Member
Join Date: Oct 2022
Old 10-25-2022 , 17:46   Re: [REQ] TF2 (Fix Spy Improvement)
Reply With Quote #2

I'm in the same boat as you, I wanna see this get fixed by someone.
MeatwadMeatwad is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-25-2022 , 21:27   Re: [REQ] TF2 (Fix Spy Improvement)
Reply With Quote #3

You'll probably want to post in the SourceMod section if you want help with SourceMod plugins .
__________________
fysiks is offline
Old 10-29-2022, 01:51
Sreaper
This message has been deleted by Sreaper. Reason: no
isinho
New Member
Join Date: Sep 2022
Location: Brazil
Old 11-09-2022 , 05:26   Re: [REQ] TF2 (Fix Spy Improvement)
Reply With Quote #4

Quote:
Originally Posted by MeatwadMeatwad View Post
I'm in the same boat as you, I wanna see this get fixed by someone.

This Plugin does the (same) QuickCloak , to change the speed you gotta modify plugin, nothing too crazy
isinho is offline
MeatwadMeatwad
Junior Member
Join Date: Oct 2022
Old 11-19-2022 , 11:19   Re: [REQ] TF2 (Fix Spy Improvement)
Reply With Quote #5

Quote:
Originally Posted by isinho View Post
This Plugin does the (same) QuickCloak , to change the speed you gotta modify plugin, nothing too crazy
That feature is cool, but the main one I wanted from the plugin was the disguise speed thing. The one where if you press R while disguised it would override the speed of your disguise to your base speed. That part of the plugin was the one causing issues with speed boosts, but the idea is great. I have seen that plugins exist that use the same concept but from what I've seen all of those are private plugins that I can't seem to find anywhere. If you got any idea where I could find one that'd be nice.

Also, I found that the quickcloak plugin breaks speed boosts in the same exact way that spy improvements does. If you get a speed boost while cloaked it just ignores it and you move at the speed that the plugin set. The dead ringer still won't work as it should so this thread still isn't really "solved" you just found a new problem to deal with.

Last edited by MeatwadMeatwad; 11-19-2022 at 11:41.
MeatwadMeatwad 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 00:02.


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