Raised This Month: $ Target: $400
 0% 

Creating forwards


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Orangutanz
Veteran Member
Join Date: Apr 2006
Old 05-30-2006 , 18:35  
Reply With Quote #2

Code:
#include <amxmodx> new PLUGIN[]="Forward Test" new VERSION[]="0.1" new AUTHOR[]="Orangutanz" new player_died new player_died_ret public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_event("DeathMsg", "DeathMsg_event", "a")     player_died = CreateMultiForward("player_died", ET_IGNORE, FP_CELL) } public DeathMsg_event() {     new id = read_data(2)     ExecuteForward(player_died, player_died_ret, id) }
As for is it more resourceful its debatable, since it depends what you are doing. A simple forward like this seems pretty pointless, but its a good example to see how it works. If you was hooking DeathMsg and was carrying out vasts checking etc and returning more than just the ID then yes its more resourceful.

How to add on the killer:
Code:
player_died = CreateMultiForward("player_died", ET_IGNORE, FP_CELL, FP_CELL) public DeathMsg_event() {     new killer = read_data(1)     new id = read_data(2)     new ret     ExecuteForward(player_died, player_died_ret, id, killer) }


Regards,

Orange Monkey
Orangutanz 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 16:26.


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