Raised This Month: $ Target: $400
 0% 

set_user_maxspeed() not work


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-31-2015 , 11:48   Re: set_user_maxspeed() not work
Reply With Quote #4

Speed gets reset when a user changes weapons so you can't just set it and forget it.

Try this:

If you want a players speed to be normal again at new round then you need to set g_bPlayersSpeedSet[ pid ] = false at spawn or new round. Let me know and I can set it up for you.
PHP Code:
#define MAX_PLAYERS 32
new bool:g_bPlayersSpeedSetMAX_PLAYERS ];

RegisterHamHam_CS_Player_ResetMaxSpeed "player" "ResetMaxSpeed" );

public 
ResetMaxSpeedid )
{
    return 
g_bPlayersSpeedSetid ] ? HAM_SUPERCEDE HAM_IGNORED;
}

public 
EventRoundStart() 
{
    if( !
g_bEnabled )
        return 
PLUGIN_CONTINUE;
    
    
g_bRandromized false;
    
g_bStarting false;
    
    new 
iiPlayers32 ], iNumiRealPlayersCsTeams:iTeam;
    
get_playersiPlayersiNum"c" );
    
    if( 
iNum <= )
        return 
PLUGIN_CONTINUE;
    
    for( 
0iNumi++ ) 
    {
        new 
pid iPlayers];
        
iTeam cs_get_user_team(pid);
        
        
// Terrorists should run faster
        // Other players have default speed
        
if( CS_TEAM_T <= iTeam <= CS_TEAM_CT )
        {
            
iRealPlayers++;
            
            
g_bPlayersSpeedSetpid ] = bool:( iTeam == CS_TEAM_T );
            
set_user_maxspeedpid , ( iTeam == CS_TEAM_T ) ? 550.0 0.0 );
        }
    }
    
    return 
PLUGIN_CONTINUE;

__________________

Last edited by Bugsy; 12-31-2015 at 11:52.
Bugsy 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 09:28.


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