Raised This Month: $ Target: $400
 0% 

ForwardEx - A more extensive forward management system


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
minimoney1
SourceMod Donor
Join Date: Dec 2010
Old 11-25-2012 , 15:49   ForwardEx - A more extensive forward management system
Reply With Quote #1

Hello everyone.
For Simple Chat Processor (Redux), I needed a way to call each forward one by one (as the current forward manager's methods call either the first or the highest depending on your settings set in CreateForward).
So here it is!

Note: This is for private forwards

Sample Plugin:
PHP Code:
#include <sourcemod>
#include <forwardex>

new Forward:g_fMyForward INVALID_FORWARD;

public 
APLRes:AskPluginLoad2(Handle:pluginbool:lateString:err[], err_max)
{
    
CreateNative("AddToMyForward"Native_Add);
    
CreateNative("RemoveFromMyForward"Native_Remove);
    return 
APLRes_Success;
}

public 
Native_Add(Handle:pluginnumParams)
{
    if (
g_fMyForward != INVALID_FORWARD)
    {
        
FwdEx_AddToForward(g_fMyForwardplugin, Function:GetNativeCell(1));
    }
}

public 
Native_Remove(Handle:pluginnumParams)
{
    if (
g_fMyForward != INVALID_FORWARD)
    {
        
FwdEx_RemoveFromForward(g_fMyForwardplugin, Function:GetNativeCell(1));
    }
}

public 
OnPluginStart()
{
    
FwdEx_Init();
    
g_fMyForward FwdEx_CreateForward();
}

public 
OnMapStart()
{
    if (
g_fMyForward != INVALID_FORWARD)
    {
        new 
bool:finish false;
        new 
bool:isTrue true;
        new 
count FwdEx_GetFwdCount(g_fMyForward);
        for (new 
0counti++)
        {
            
finish false;
            
Call_StartPrivateForward(g_fMyForwardForwardId:i);
            
Call_PushCellRef(isTrue);
            
Call_Finish(finish);
            if (!
finish)
            {
                
isTrue true;
            }
        }
    }
}

public 
OnPluginEnd()
{
    
FwdEx_End();

Please let me know of any bugs/questions/suggestions.

Thank you
Attached Files
File Type: sp Get Plugin or Get Source (fwdex_sample.sp - 177 views - 1.2 KB)
File Type: inc forwardex.inc (3.1 KB, 192 views)
__________________
Need help? PM me or add me on Steam.
My Steam




Quote:
Originally Posted by Rp.KryptoNite View Post
For some reason his Plugin never worked for me ,
@credits were added
im not stealing any plugins dude its my THING

Last edited by minimoney1; 11-25-2012 at 22:55.
minimoney1 is offline
 


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 18:37.


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