Raised This Month: $ Target: $400
 0% 

Wondering how to force duck with Orpheu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wirehead
Junior Member
Join Date: Dec 2010
Old 01-05-2011 , 18:33   Wondering how to force duck with Orpheu
Reply With Quote #1

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?
wirehead is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-06-2011 , 03:17   Re: Wondering how to force duck with Orpheu
Reply With Quote #2

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.
__________________
Arkshine is offline
wirehead
Junior Member
Join Date: Dec 2010
Old 01-06-2011 , 03:32   Re: Wondering how to force duck with Orpheu
Reply With Quote #3

I don't know how to use the function though. Please show me how to apply it to a player.
wirehead is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-06-2011 , 03:56   Re: Wondering how to force duck with Orpheu
Reply With Quote #4

PM_Move is called for all players, and the current player's index is passed by : new player = OrpheuGetParamStructMember( 1, "player_index" ) + 1;
__________________
Arkshine is offline
wirehead
Junior Member
Join Date: Dec 2010
Old 01-06-2011 , 04:05   Re: Wondering how to force duck with Orpheu
Reply With Quote #5

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?
wirehead is offline
ARES[ro]
Senior Member
Join Date: Apr 2010
Old 01-06-2011 , 14:58   Re: Wondering how to force duck with Orpheu
Reply With Quote #6

I have solution take a look at Arkshine`s prone plugin that is where he changes the player hull to pointhull (2).
__________________
okay
ARES[ro] is offline
wirehead
Junior Member
Join Date: Dec 2010
Old 01-07-2011 , 16:14   Re: Wondering how to force duck with Orpheu
Reply With Quote #7

Ares[ro], that's the original post's premise.

If I knew how to use the function, I wouldn't have made this thread.
wirehead is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-07-2011 , 16:16   Re: Wondering how to force duck with Orpheu
Reply With Quote #8

Will try later.
__________________
Arkshine is offline
wirehead
Junior Member
Join Date: Dec 2010
Old 01-08-2011 , 00:07   Re: Wondering how to force duck with Orpheu
Reply With Quote #9

Thank you.
wirehead 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 02:08.


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