Raised This Month: $ Target: $400
 0% 

Forward string


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 11-13-2007 , 10:23   Re: Forward string
Reply With Quote #3

The only thing i can think and tested, is to call a forward to main plugin and send the modified string ...here is an e.g (Works):

Main:
Code:
#include <amxmodx>
 
#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Alka"
 
new g_MultiForward;
new g_MultiForwardResult;
 
public plugin_init() {
 
 register_plugin(PLUGIN, VERSION, AUTHOR);
 
 g_MultiForward = CreateMultiForward("Function_Show_Msg", ET_IGNORE, FP_CELL, FP_STRING, FP_STRING, FP_STRING);
 
 register_clcmd("say /test", "TestMultiForward");
}
 
public plugin_end()
 DestroyForward(g_MultiForward);
 
public TestMultiForward(id)
{
 static String[32], String1[32], String2[32];
 static Cell;
 
 formatex(String, sizeof String - 1, "wow");
 formatex(String1, sizeof String1 - 1, "is working!");
 formatex(String2, sizeof String2 - 1, "Woot :D");
 
 Cell = id;
 
 ExecuteForward(g_MultiForward, g_MultiForwardResult, Cell, String, String1, String2);
}
 
public Function_Show_Msg_Main(id, String1[], String2[], String3[])
{
 client_print(id, print_chat, "%s %s%s", String1, String2, String3);
}
Sample:
Code:
#include <amxmodx>
 
#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Alka"
 
new g_MultiForward;
new g_MultiForwardResult;
 
public plugin_init() {
 
 register_plugin(PLUGIN, VERSION, AUTHOR);
 
 g_MultiForward = CreateMultiForward("Function_Show_Msg_Main", ET_IGNORE, FP_CELL, FP_STRING, FP_STRING, FP_STRING);
}
 
public plugin_end()
 DestroyForward(g_MultiForward);
 
public Function_Show_Msg(id, String1[], String2[], String3[])
{
 client_print(id, print_chat, "%s %s%s", String1, String2, String3);
 
 static String1m[32], String2m[32], String3m[32];
 
 format(String1m, sizeof String1m - 1, "%s[Modified]", String1);
 format(String2m, sizeof String2m - 1, "%s[Modified]", String2);
 format(String3m, sizeof String3m - 1, "%s[Modified]", String3);
 
 static Cell;
 Cell = id;
 
 ExecuteForward(g_MultiForward, g_MultiForwardResult, Cell, String1m, String2m, String3m);
}
Maybe someone know a better way ?!
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
 



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:23.


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