AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Ladder and +jump (https://forums.alliedmods.net/showthread.php?t=172762)

neverminde 11-25-2011 17:30

Ladder and +jump
 
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.

ConnorMcLeod 11-25-2011 17:42

Re: Ladder and +jump
 
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)
        }
    }



neverminde 11-26-2011 08:21

Re: Ladder and +jump
 
Thank you very much, Connor.


All times are GMT -4. The time now is 08:34.

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