AlliedModders

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

whosyourdaddy 02-01-2009 16:29

DestroyForward help
 
can any1 let me know what
Code:

DestroyForward


is used for and a quick example in how to use it and why people will use this

BOYSplayCS 02-01-2009 16:35

Re: DestroyForward help
 
You're lucky, I was just studying this earlier today.

DestroyForward() is basically used to destroy any forwards you set it to. It's found in the AMXx Core and doesn't require additional modules to run/compile.

here's an example

PHP Code:

set_task(delay,"fnDoForward"

PHP Code:

public fnDoForward()
{
    new 
iForward CreateMultiForward("plugin_init_delay",ET_IGNORE,FP_FLOAT),iReturn
    
if(iForward 0)
        return 
log_amx("Forward could not be created.")
    
    if(!
ExecuteForward(iForward,iReturn,delay))
        return 
log_amx("Could not execute forward.")
            return 
DestroyForward(iForward)



Emp` 02-01-2009 17:56

Re: DestroyForward help
 
Here is how I use it in PokeMod:
Code:

                static temp_forward, temp_return;

                //skill is from another plugin
                if( SkillInfo[skill] & SI_PUBLIC )
                        temp_forward = CreateMultiForward( SkillName[skill], ET_STOP, FP_CELL, FP_CELL, FP_CELL);
                //skill is in pokemod
                else
                        temp_forward = CreateOneForward( plugin_id, SkillName[skill], FP_CELL, FP_CELL, FP_CELL );

                ExecuteForward( temp_forward, temp_return, id, skill, prop );
                DestroyForward( temp_forward );



All times are GMT -4. The time now is 01:43.

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