Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

RSS[REQ] TF2 (Fix Spy Improvement)


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
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 ([b]320[b]) , Spy walkspeed is capped (Any speed boost doesnt work)
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

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);


Przeczytaj cały wpis

Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...