Raised This Month: $ Target: $400
 0% 

sv_maxspeed and set_user_maxspeed


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 08-27-2007 , 14:09   Re: sv_maxspeed and set_user_maxspeed
Reply With Quote #4

This will set the spys speed to the class they disguised as and reset their speed to normal when they undisguise. I think this is what you are trying to do? If so, none of that other code is needed. Also, the maxspeed doesn't need to be changed for this to work. 400 is default maxspeed in TFC.

Note: Maxspeed in TFC can go up to 2000. I saw the other thread said maxspeed is 1000, not sure if that's only CS or what.

PHP Code:
public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_event("StatusText""hook_StatusText""b""2&Spy_disguised");
    
register_event("TextMsg""hook_TextMsg""b""2&Disguise_Lost");
}

public 
hook_TextMsg(id)
{
    
// Spy lost their disguise, reset their speed
    
engfunc(EngFunc_SetClientMaxspeedid300.0);
}

public 
hook_StatusText(id)
{
    new 
arg2[64];
    
read_data(2arg263);
    
    if(
containi(arg2"Scout") != -1)
    {
        
// Disguised as Scout
        
engfunc(EngFunc_SetClientMaxspeedid400.0);
    }
    else if(
containi(arg2"Sniper") != -1)
    {
        
// Disguised as Sniper
        
engfunc(EngFunc_SetClientMaxspeedid300.0);
    }
    else if(
containi(arg2"Soldier") != -1)
    {
        
// Disguised as Soldier
        
engfunc(EngFunc_SetClientMaxspeedid240.0);
    }
    else if(
containi(arg2"Demoman") != -1)
    {
        
// Disguised as Demoman
        
engfunc(EngFunc_SetClientMaxspeedid280.0);
    }
    else if(
containi(arg2"Medic") != -1)
    {
        
// Disguised as Medic
        
engfunc(EngFunc_SetClientMaxspeedid320.0);
    }
    else if(
containi(arg2"HWGuy") != -1)
    {
        
// Disguised as HWGuy
        
engfunc(EngFunc_SetClientMaxspeedid230.0);
    }
    else if(
containi(arg2"Pyro") != -1)
    {
        
// Disguised as Pyro
        
engfunc(EngFunc_SetClientMaxspeedid300.0);
    }
    else if(
containi(arg2"Spy") != -1)
    {
        
// Disguised as Spy
        
engfunc(EngFunc_SetClientMaxspeedid300.0);
    }
    else if(
containi(arg2"Engineer") != -1)
    {
        
// Disguised as Engineer
        
engfunc(EngFunc_SetClientMaxspeedid300.0);
    }


Last edited by hlstriker; 08-27-2007 at 14:20.
hlstriker is offline
 



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 16:17.


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