Raised This Month: $12 Target: $400
 3% 

Solved Multiforward help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
38e4m
New Member
Join Date: Apr 2022
Old 04-15-2022 , 05:44   Multiforward help
Reply With Quote #1

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)
{



Last edited by 38e4m; 04-16-2022 at 20:19.
38e4m is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 04-15-2022 , 09:48   Re: Multiforward help
Reply With Quote #2

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?
__________________








CrazY. is offline
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 04-15-2022 , 10:03   Re: Multiforward help
Reply With Quote #3

you need to call execute forward many-many times/second?
__________________
Now working on: Side Weapons (Very lazy, tbh)
Avatar source: https://bit.ly/3BAk19g
Discord: kww#9951
kww is offline
38e4m
New Member
Join Date: Apr 2022
Old 04-16-2022 , 05:38   Re: Multiforward help
Reply With Quote #4

Quote:
Originally Posted by CrazY. View Post
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)
38e4m is offline
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 04-16-2022 , 06:56   Re: Multiforward help
Reply With Quote #5

for jumps you can hook Ham_Player_Jump
__________________
Now working on: Side Weapons (Very lazy, tbh)
Avatar source: https://bit.ly/3BAk19g
Discord: kww#9951
kww is offline
Reply


Thread Tools
Display Modes

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 10:55.


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