AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Wondering how to force duck with Orpheu (https://forums.alliedmods.net/showthread.php?t=147142)

wirehead 01-05-2011 18:33

Wondering how to force duck with Orpheu
 
Here's the portion of code from Arkshine's prone position plugin that seems to force a swimming position on a standing player, but I don't know how it is set on the player. Can someone explain please?

(from the plugin linked in https://forums.alliedmods.net/showpo...6&postcount=27)

Code:

    public PM_Move ( const OrpheuStruct:ppmove, const server )
    {
        handleStructPMove = OrpheuGetStructFromParam( 1 );
        new player = OrpheuGetParamStructMember( 1, "player_index" ) + 1;

        if ( !FBitSet( isAlive, player ) )
        {
            return;
        }

        if ( FBitSet( isProning, player ) )
        {
            OrpheuSetParamStructMember( 1, "usehull", 2 );
        }
        else
        {
            if ( FBitSet( unStuckMe, player ) )
            {
                ClearBits( unStuckMe, player );
                PM_FixPlayerCrouchStuck( STUCK_MOVEUP );
            }
        }
    }

Seems like " OrpheuSetParamStructMember( 1, "usehull", 2 ); " is what sets the player size, but how is that applied to a player?

Arkshine 01-06-2011 03:17

Re: Wondering how to force duck with Orpheu
 
I'm not sure it's a good idea, but you can try to change for usehull 1 instead of 2.

0 = regular player hull, 1 = ducked player hull, 2 = point hull

And also forcing player if need to play the duck animation.

wirehead 01-06-2011 03:32

Re: Wondering how to force duck with Orpheu
 
I don't know how to use the function though. Please show me how to apply it to a player.

Arkshine 01-06-2011 03:56

Re: Wondering how to force duck with Orpheu
 
PM_Move is called for all players, and the current player's index is passed by : new player = OrpheuGetParamStructMember( 1, "player_index" ) + 1;

wirehead 01-06-2011 04:05

Re: Wondering how to force duck with Orpheu
 
Thanks for the help, but I'm still kind of lost, having not used Orpheu before.

If it's not too much, could you please write up an example that causes a player to duck when some global variable like IsDucking[id] = 1?

ARES[ro] 01-06-2011 14:58

Re: Wondering how to force duck with Orpheu
 
I have solution take a look at Arkshine`s prone plugin that is where he changes the player hull to pointhull (2).

wirehead 01-07-2011 16:14

Re: Wondering how to force duck with Orpheu
 
Ares[ro], that's the original post's premise.

If I knew how to use the function, I wouldn't have made this thread.

Arkshine 01-07-2011 16:16

Re: Wondering how to force duck with Orpheu
 
Will try later.

wirehead 01-08-2011 00:07

Re: Wondering how to force duck with Orpheu
 
Thank you.


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

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