Raised This Month: $ Target: $400
 0% 

Freeze Code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lolzin123
Member
Join Date: Apr 2009
Old 08-10-2009 , 14:42   Freeze Code
Reply With Quote #1

How i freeze the player per 10 seconds...

OBS: If the player stwich the weapon your maxspeed is set to default.

I have tryed with this code:
PHP Code:
 set_pevidpev_flagspevidpev_flags ) | FL_FROZEN ); + set_task()

To removeset_pevidpev_flagspevidpev_flags ) & ~FL_FROZEN ); 
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.
lolzin123 is offline
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 08-10-2009 , 17:04   Re: Freeze Code
Reply With Quote #2

Show the code. That have to work perfect.
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 08-10-2009 , 18:20   Re: Freeze Code
Reply With Quote #3

try to use set_task. like

set_task(1.0,"my_timer")

public my_timer()
{
the_time++
if(the_time < 10)
set_user_maxspeed(id,0)
else
set_user_maxspeed(id,320)
}
somthing like this
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-10-2009 , 21:03   Re: Freeze Code
Reply With Quote #4

Afaik, you shouldn't be setting the FL_FROZEN flag in CurWeapon
__________________
fysiks is offline
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
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 18:31.


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