Raised This Month: $ Target: $400
 0% 

DestroyForward help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
whosyourdaddy
Senior Member
Join Date: Apr 2008
Old 02-01-2009 , 16:29   DestroyForward help
Reply With Quote #1

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
whosyourdaddy is offline
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 02-01-2009 , 16:35   Re: DestroyForward help
Reply With Quote #2

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)

BOYSplayCS is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 02-01-2009 , 17:56   Re: DestroyForward help
Reply With Quote #3

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 );
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
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 01:43.


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