AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Multiforward help (https://forums.alliedmods.net/showthread.php?t=337346)

38e4m 04-15-2022 05:44

Multiforward help
 
PHP Code:

new fwret

public plugin_init()
{
    
register_forward(FM_PlayerPreThink"Player_Movement")

    
fw CreateMultiForward("Movement"ET_CONTINUEFP_CELLFP_CELLFP_CELL)
}

public 
Player_Movement(index)
{
    new 
flags pev(indexpev_flags)
    new 
button pev(indexpev_button)
    new 
oldbutton pev(indexpev_oldbuttons)

    
ExecuteForward(fwretindexflagsbuttonoldbutton);


then

PHP Code:


forward Movement
(indexflagsbuttonoldbutton)

public 
Movement(indexflagsbuttonoldbutton)
{
    if(
flags FL_ONGROUND)
    {

    }

    if(
button IN_JUMP)
    {
    
    }

    if(
oldbutton IN_JUMP)
    {
        
    }


Solved

PHP Code:

ExecuteForward(fwretindexflagsbuttonoldbutton); 

- >

PHP Code:

if(!ExecuteForward(fwretindexflagsbuttonoldbutton)
{




CrazY. 04-15-2022 09:48

Re: Multiforward help
 
The question is too vague, you have to be as descriptive as possible.
What exactly doesn't work and what are you trying to do?

kww 04-15-2022 10:03

Re: Multiforward help
 
you need to call execute forward many-many times/second?

38e4m 04-16-2022 05:38

Re: Multiforward help
 
Quote:

Originally Posted by CrazY. (Post 2776884)
The question is too vague, you have to be as descriptive as possible.
What exactly doesn't work and what are you trying to do?

What i'm trying to do is to create a forward from prethink, pretty much as a wrapper and pass certain functions such as in the example that i've posted. Its purpose is to be used in multiple plugins without creating the checks everytime. I don't think it's good practice but i need someone to show me a way to do this properly). Thanks)

kww 04-16-2022 06:56

Re: Multiforward help
 
for jumps you can hook Ham_Player_Jump


All times are GMT -4. The time now is 21:19.

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