Raised This Month: $ Target: $400
 0% 

Ladder and +jump


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
neverminde
Senior Member
Join Date: Feb 2011
Location: St.Piter
Old 11-25-2011 , 17:30   Ladder and +jump
Reply With Quote #1

Hi there,
I want freeze player at current place.
When he on the ground I can freeze him by setting maxspeed ( have only weapon_knife )
But if player on a ladder, he can use +jump, so he will get off and have some move.
I have read all threads about blocking +jump command. So it does not exist any solid method to block jumping. ( maybe orpheu can, but i cant use this module )

I tried to check is player on ladder and change velocity like this. So player will be returned to a ladder.
PHP Code:
static Float:velocity[3];
pev(id,pev_velocity,velocity)
velocity[0] = -velocity[0]
velocity[1] = -velocity[1]
set_pev(id,pev_velocity,velocity); 
But after 3-4 times fast pressed +jump it will get off from ladder.
neverminde is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-25-2011 , 17:42   Re: Ladder and +jump
Reply With Quote #2

You can freeze players anywhere with this way :
PHP Code:
Freezeid )
{
    if( 
is_user_alive(id) )
    {
        new 
iFlags pev(idpev_flags)
        if( ~
iFlags FL_FROZEN )
        {
            
set_pev(idpev_flagsiFlags FL_FROZEN)
        }
    }
}

UnFreezeid )
{
    if( 
is_user_alive(id) )
    {
        new 
iFlags pev(idpev_flags)
        if( 
iFlags FL_FROZEN )
        {
            
set_pev(idpev_flagsiFlags & ~FL_FROZEN)
        }
    }

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
neverminde
Senior Member
Join Date: Feb 2011
Location: St.Piter
Old 11-26-2011 , 08:21   Re: Ladder and +jump
Reply With Quote #3

Thank you very much, Connor.
neverminde 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 08:34.


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