Raised This Month: $ Target: $400
 0% 

Freeze Code


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-10-2009 , 21:43   Re: Freeze Code
Reply With Quote #5

Quote:
Originally Posted by lolzin123 View Post
How i freeze the player per 10 seconds...

OBS: If the player stwich the weapon your maxspeed is set to default.
This method is not using maxspeed so it doesn't matter if maxspeed is reset @ CurWeapon.

Quote:
Originally Posted by lolzin123 View Post
I have tryed with this code:
PHP Code:
 set_pevidpev_flagspevidpev_flags ) | FL_FROZEN ); + set_task()

To removeset_pevidpev_flagspevidpev_flags ) & ~FL_FROZEN ); 
This will work, see below.

Quote:
Originally Posted by lolzin123 View Post
But if the player are walking and this code are in action the screen of player bug.

Any other code without CurWeapon?

OBS: this code are used at blocks, like bm.
I assume you are referring to the screen shaking if you apply FL_FROZEN while the player is moving? If so this can be solved by zeroing the players velocity before freezing.

PHP Code:
const Floatg_fFreezeSeconds 10.0;
new 
boolg_bFrozen33 ];

public 
client_disconnectid )
{
    
//Just in case player disconnects while frozen.
    
g_bFrozenid ] = false;
}

public 
FreezePlayerid )
{
    if ( !
is_user_connectedid ) )
        return 
PLUGIN_HANDLED;

    if ( !
g_bFrozenid ] )
    {
        
set_pevid pev_velocity , { 0.0 0.0 0.0 } );
        
set_pevid pev_flags pevid pev_flags ) | FL_FROZEN ); 

        
set_taskg_fFreezeSeconds "fn_Freeze" id );
    }
    else
    {
        
set_pevid pev_flags pevid pev_flags ) & ~FL_FROZEN ); 
    }
    
    
client_printid print_chat "* You are %s frozen!" g_bFrozenid ] ? "no longer" "now" );
    
    
g_bFrozenid ] = !g_bFrozenid ];

    return 
PLUGIN_HANDLED;

__________________

Last edited by Bugsy; 08-10-2009 at 23:30.
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 18:31.


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